html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #fff;
  color: #000;
}

body,
button,
input,
select,
textarea {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  line-height: 1.45;
}

body {
  -webkit-text-size-adjust: 100%;
}

#page {
  position: relative;
  width: 100%;
  max-width: 720px;
  height: 100%;
  margin: 0 auto;
  padding: 0 10px;
  overflow: hidden;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}

.hidden {
  display: none;
}

.app-view,
.reader-shell {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.reader-pages {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 68px;
  left: 0;
  overflow: hidden;
}

.kindle-page {
  display: none;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 9px 2px;
  overflow: hidden;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}

.kindle-page.active {
  display: block;
}

.measure-page {
  display: block;
  z-index: -100;
  visibility: hidden;
  pointer-events: none;
}

.header {
  margin-bottom: 10px;
  padding: 3px 0 8px;
  border-bottom: 3px solid #000;
}

.header h1,
.header p,
.login-title h1,
.login-title p,
.conversation-heading h2,
.conversation-heading p {
  margin: 0;
}

.header h1,
.login-title h1 {
  font-size: 30px;
}

.header p,
.login-title p,
.conversation-heading p,
.footer-note,
.home-summary {
  font-size: 16px;
}

h2 {
  margin: 5px 0 9px;
  font-size: 24px;
}

.panel,
.notice {
  margin: 9px 0;
  padding: 9px;
  border: 2px solid #000;
  background: #fff;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}

.notice {
  border-style: dashed;
  font-size: 16px;
}

.home-notice {
  margin: 7px 0;
  padding: 7px 9px;
}

.error {
  border-style: solid;
  border-width: 3px;
  font-weight: bold;
}

.error-text {
  min-height: 1.4em;
  margin: 6px 0;
  font-weight: bold;
}

.login-view {
  height: 100%;
  padding-top: 18px;
  overflow: hidden;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}

.login-title {
  padding-bottom: 10px;
  border-bottom: 3px solid #000;
}

.login-panel {
  margin-top: 18px;
}

.control-row {
  margin-bottom: 8px;
}

label {
  display: block;
  margin-bottom: 3px;
  font-weight: bold;
}

input,
select,
textarea,
button {
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}

input,
select,
textarea {
  display: block;
  width: 100%;
  padding: 7px;
  border: 2px solid #000;
  border-radius: 0;
  background: #fff;
  color: #000;
}

input,
select {
  min-height: 46px;
}

textarea {
  height: 126px;
  min-height: 126px;
  max-height: 126px;
  overflow: auto;
  resize: none;
}

button {
  min-height: 46px;
  margin: 3px 4px 3px 0;
  padding: 6px 11px;
  border: 2px solid #000;
  border-radius: 0;
  background: #fff;
  color: #000;
  font-weight: bold;
}

button.primary {
  width: 100%;
  border-width: 3px;
  background: #000;
  color: #fff;
}

button.confirm-delete {
  border-width: 3px;
  background: #000;
  color: #fff;
}

button:disabled {
  color: #555;
  border-color: #777;
  background: #ddd;
}

.button-row {
  margin-top: 3px;
}

.conversation-heading {
  margin: 8px 0 5px;
  padding-bottom: 5px;
  border-bottom: 2px solid #000;
}

.conversation-heading h2 {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.home-summary {
  display: none;
  padding: 8px 0;
}

.page-kicker {
  font-size: 16px;
  font-weight: bold;
}

.composer {
  margin-top: 6px;
}

.home-composer {
  padding: 8px;
}

.status {
  min-height: 1.5em;
  max-height: 2.9em;
  margin: 7px 0;
  overflow: hidden;
  font-size: 16px;
  font-weight: bold;
}

.footer-note {
  margin: 8px 0 0;
  padding-top: 7px;
  border-top: 1px solid #000;
}

.reading-card {
  margin: 0;
  padding: 11px;
  border: 2px solid #000;
  background: #fff;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}

.reading-heading {
  margin: 0 0 9px;
  padding-bottom: 7px;
  border-bottom: 2px solid #000;
  overflow: hidden;
  font-size: 16px;
  font-weight: bold;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reading-text {
  font-size: 20px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-wrap: break-word;
  word-break: break-all;
}

.reading-footer {
  margin-top: 10px;
  padding-top: 7px;
  border-top: 1px dotted #000;
  font-size: 16px;
  font-weight: bold;
}

.page-nav {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 62px;
  border-top: 3px solid #000;
  background: #fff;
}

.page-nav button {
  position: absolute;
  top: 7px;
  width: 29%;
  height: 48px;
  min-height: 48px;
  margin: 0;
  padding: 4px;
}

#prev-page {
  left: 0;
}

#next-page {
  right: 0;
}

#page-indicator {
  position: absolute;
  top: 7px;
  left: 30%;
  width: 40%;
  height: 48px;
  min-height: 48px;
  margin: 0;
  padding: 4px;
  text-align: center;
  font-size: 17px;
  font-weight: bold;
}

@media screen and (max-width: 480px) {
  body,
  button,
  input,
  select,
  textarea {
    font-size: 18px;
  }

  #page {
    padding: 0 7px;
  }

  .kindle-page {
    padding-top: 7px;
  }

  .panel,
  .notice,
  .reading-card {
    padding: 7px;
  }

  .header h1,
  .login-title h1 {
    font-size: 27px;
  }

  .reading-text {
    font-size: 19px;
  }

  .button-row button {
    min-height: 43px;
    padding: 4px 7px;
    font-size: 17px;
  }

  /* Keep every action reachable on phone-sized Kindle/browser viewports. */
  .button-row {
    display: block;
    white-space: normal;
  }

  .button-row button {
    margin-right: 2px;
  }
}

/* Keep all first-page actions on one touch row in the legacy 600px CSS viewport. */
@media screen and (max-width: 899px) {
  .button-row {
    white-space: nowrap;
  }

  .button-row button {
    min-height: 46px;
    margin-right: 2px;
    padding: 5px 7px;
    font-size: 18px;
  }
}

@media screen and (max-height: 760px) {
  .header {
    margin-bottom: 4px;
    padding: 0 0 3px;
  }

  .header p,
  .conversation-heading {
    display: none;
  }

  .home-notice,
  .panel {
    margin: 5px 0;
    padding: 6px;
  }

  .conversation-heading {
    margin: 7px 0 4px;
  }

  .home-summary,
  .footer-note {
    padding-top: 4px;
  }

  textarea {
    height: 64px;
    min-height: 64px;
    max-height: 64px;
  }

  .status {
    min-height: 1.35em;
    max-height: 2.7em;
    margin: 4px 0;
    font-size: 15px;
    line-height: 1.35;
  }

  .home-summary {
    display: none;
  }
}

/* Kindle Voyage native 1072 x 1448 layout. */
@media screen and (min-width: 900px) {
  body,
  button,
  input,
  select,
  textarea {
    font-size: 30px;
    line-height: 1.42;
  }

  #page {
    max-width: none;
    padding-right: 3%;
    padding-left: 3%;
  }

  .reader-pages {
    bottom: 128px;
  }

  .kindle-page {
    padding: 14px 5px;
  }

  .header {
    margin-bottom: 14px;
    padding: 4px 0 11px;
    border-bottom-width: 4px;
  }

  .header h1,
  .login-title h1 {
    font-size: 48px;
  }

  .header p,
  .login-title p,
  .conversation-heading p,
  .footer-note,
  .home-summary {
    font-size: 26px;
  }

  h2 {
    margin: 8px 0 12px;
    font-size: 38px;
  }

  .panel,
  .notice {
    margin: 12px 0;
    padding: 14px;
    border-width: 3px;
  }

  .notice {
    font-size: 25px;
  }

  .control-row {
    margin-bottom: 12px;
  }

  label {
    margin-bottom: 5px;
  }

  input,
  select,
  textarea {
    padding: 11px;
    border-width: 3px;
  }

  input,
  select {
    min-height: 80px;
  }

  textarea {
    height: 160px;
    min-height: 160px;
    max-height: 160px;
  }

  button {
    min-height: 92px;
    margin: 5px 7px 5px 0;
    padding: 10px 17px;
    border-width: 3px;
  }

  .conversation-heading {
    margin: 12px 0 8px;
    padding-bottom: 8px;
    border-bottom-width: 3px;
  }

  .page-kicker,
  .status,
  .reading-footer {
    font-size: 26px;
  }

  .home-composer {
    padding: 14px;
  }

  .status {
    margin: 8px 0;
  }

  .reading-card {
    padding: 18px;
    border-width: 3px;
  }

  .reading-heading {
    margin: 0 0 13px;
    padding-bottom: 10px;
    border-bottom-width: 3px;
    font-size: 26px;
  }

  .reading-text {
    font-size: 34px;
    line-height: 1.5;
  }

  .reading-footer {
    margin-top: 14px;
    padding-top: 10px;
  }

  .page-nav {
    height: 120px;
    border-top-width: 4px;
  }

  .page-nav button,
  #page-indicator {
    top: 10px;
    height: 96px;
    min-height: 96px;
    padding: 8px;
    font-size: 28px;
  }

  #page-indicator {
    overflow: hidden;
    white-space: nowrap;
  }
}

/* Voyage portrait with the browser toolbar reducing usable height. */
@media screen and (min-width: 900px) and (max-width: 1199px) and (max-height: 1300px) {
  .header {
    margin-bottom: 8px;
    padding: 0 0 6px;
  }

  .header p,
  .conversation-heading p {
    display: none;
  }

  .panel,
  .notice {
    margin: 10px 0;
    padding: 13px;
  }

  .conversation-heading {
    margin: 8px 0 6px;
    padding-bottom: 6px;
  }

  textarea {
    height: 150px;
    min-height: 150px;
    max-height: 150px;
  }
}

/* Voyage landscape keeps the first-page form within the shorter viewport. */
@media screen and (min-width: 1200px) and (max-height: 1150px) {
  body,
  button,
  input,
  select,
  textarea {
    font-size: 28px;
  }

  .reader-pages {
    bottom: 116px;
  }

  .kindle-page {
    padding-top: 9px;
  }

  .header {
    margin-bottom: 7px;
    padding: 0 0 6px;
  }

  .header h1,
  .login-title h1 {
    font-size: 44px;
  }

  .header p,
  .conversation-heading {
    display: none;
  }

  .panel,
  .notice {
    margin: 8px 0;
    padding: 11px;
  }

  .control-row {
    margin-bottom: 8px;
  }

  input,
  select {
    min-height: 74px;
  }

  textarea {
    height: 118px;
    min-height: 118px;
    max-height: 118px;
  }

  button {
    min-height: 84px;
    margin-top: 4px;
    margin-bottom: 4px;
    padding-top: 7px;
    padding-bottom: 7px;
  }

  .home-composer {
    padding: 11px;
  }

  .status {
    margin: 5px 0;
    font-size: 24px;
    line-height: 1.3;
  }

  .reading-heading {
    font-size: 25px;
  }

  .reading-text {
    font-size: 32px;
  }

  .page-kicker,
  .reading-footer {
    font-size: 25px;
  }

  .page-nav {
    height: 108px;
  }

  .page-nav button,
  #page-indicator {
    top: 9px;
    height: 86px;
    min-height: 86px;
    font-size: 27px;
  }
}
