:root {
  --bg: #f6f6f6;
  --paper: #fff;
  --ink: #262626;
  --muted: #787878;
  --line: #e0e0e0;
  --green: #3b3b3b;
  --lime: #d1d1d1;
  --lime-light: #eaeaea;
  --orange: #767676;
  --red: #ae4242;
  --sidebar: 226px;
  --serif: Georgia, 'Noto Serif SC', 'Songti SC', serif;
  --sans: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif
}

* {
  box-sizing: border-box
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased
}

a {
  color: inherit;
  text-decoration: none
}

button,
input,
textarea,
select {
  font: inherit
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent
}

button {
  cursor: pointer
}

button:disabled {
  opacity: .45;
  cursor: not-allowed
}

button {
  border-radius: 0
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid #6b6b6b;
  outline-offset: 3px
}

svg {
  vertical-align: middle;
  flex-shrink: 0
}

h1,
h2,
h3,
p {
  margin: 0
}

h1 {
  font-size: 31px;
  line-height: 1.35;
  letter-spacing: -1px;
  font-weight: 600
}

h2 {
  font-size: 19px;
  letter-spacing: -.4px;
  font-weight: 600
}

h3 {
  font-size: 16px;
  font-weight: 600
}

small {
  font-size: 12px
}

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar);
  background: var(--paper);
  border-right: 1px solid var(--line);
  padding: 31px 22px;
  display: flex;
  flex-direction: column;
  z-index: 20
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 19px;
  line-height: 1.3;
  letter-spacing: .5px
}

.brand b {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -.5px;
  margin-left: 4px
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 6px;
  letter-spacing: .6px
}

.brand-mark {
  width: 37px;
  height: 42px;
  background: var(--green);
  color: var(--lime);
  font-size: 33px;
  font-weight: 500;
  line-height: 41px;
  padding-left: 8px;
  position: relative
}

.brand-mark>span {
  position: absolute;
  right: 5px;
  top: -10px;
  font-size: 29px
}

.workspace-label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 8px;
  color: #9a9a9a;
  letter-spacing: 1.5px;
  margin: 47px 2px 14px
}

.workspace-label>span {
  letter-spacing: 0
}

#navigation {
  display: grid;
  gap: 6px
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  color: #7b837c;
  font-size: 13px;
  transition: background .15s, color .15s
}

.nav-item.active {
  background: var(--lime-light);
  color: var(--green);
  font-weight: 600
}

.nav-item:hover {
  background: #f2f2f2;
  color: var(--green)
}

.nav-item .nav-count {
  margin-left: auto;
  font-size: 10px;
  font-weight: 400;
  background: var(--green);
  color: #fff;
  min-width: 21px;
  text-align: center;
  padding: 1px 4px
}

.nav-divider {
  height: 1px;
  background: var(--line);
  margin: 14px 10px
}

.sidebar-bottom {
  margin-top: auto;
  padding: 23px 11px 0;
  border-top: 1px solid var(--line)
}

.local-indicator {
  font-size: 11px;
  color: var(--green)
}

.local-indicator i {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #787878;
  margin-right: 7px
}

.sidebar-bottom p {
  font-size: 10px;
  color: #939393;
  margin: 9px 0 17px;
  line-height: 1.9
}

.subtle-link {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #696969
}

.app-shell {
  margin-left: var(--sidebar)
}

.topbar {
  height: 78px;
  margin: 0 43px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px
}

.breadcrumb {
  font-size: 9px;
  letter-spacing: 1.7px;
  color: #898989;
  display: flex;
  align-items: center;
  gap: 16px
}

.breadcrumb strong {
  font-size: 11px;
  letter-spacing: 0;
  color: #585858;
  font-weight: 400
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 20px
}

#today-date {
  font-size: 10px;
  letter-spacing: .5px;
  color: #8c8c8c
}

.avatar {
  background: #eaeaea;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  font-size: 11px;
  color: #797979
}

.icon-button {
  width: 33px;
  height: 33px;
  border: 1px solid transparent;
  background: none;
  display: inline-grid;
  place-items: center;
  color: var(--green);
  padding: 0
}

.icon-button:hover {
  background: var(--lime-light);
  border-color: var(--line)
}

.icon-button svg {
  width: 18px;
  height: 18px
}

#main {
  padding: 32px 43px 28px;
  min-height: calc(100vh - 134px);
  max-width: 1640px;
  margin: 0 auto;
  outline: none
}

.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin: 0 0 25px
}

.eyebrow {
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--muted);
  margin-bottom: 10px;
  text-transform: uppercase
}

.page-heading p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px
}

.page-actions {
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap
}

.btn {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  color: var(--green);
  border: 1px solid var(--line);
  padding: 10px 17px;
  font-size: 12px;
  min-height: 39px;
  transition: background .15s
}

.btn:hover {
  background: #efefef
}

.btn.primary {
  background: var(--green);
  color: #fff;
  border-color: var(--green)
}

.btn.primary:hover {
  background: #4e4e4e
}

.btn.lime {
  background: var(--lime);
  border-color: var(--lime);
  color: var(--green)
}

.btn.danger {
  border-color: #e7c8c4;
  color: var(--red)
}

.btn.small {
  min-height: 31px;
  padding: 6px 11px;
  font-size: 11px
}

.btn.text {
  background: transparent;
  border-color: transparent;
  padding: 4px 0;
  min-height: auto
}

.btn svg {
  width: 15px;
  height: 15px
}

.hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  background: #e8e8e8;
  border: 1px solid #d9d9d9;
  min-height: 250px;
  position: relative;
  overflow: hidden;
  margin-bottom: 24px
}

.hero-copy {
  padding: 29px 34px;
  z-index: 1
}

.hero .eyebrow {
  color: #707070;
  font-size: 8px;
  margin-bottom: 14px
}

.hero h2 {
  font-size: 37px;
  line-height: 1.38;
  letter-spacing: -1.5px;
  font-weight: 500
}

.hero h2 span {
  font-family: var(--serif);
  font-style: italic;
  color: #646464
}

.hero p {
  font-size: 11px;
  color: #747474;
  margin: 13px 0 19px;
  max-width: 380px
}

.hero-art {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden
}

.hero-art:before {
  content: '';
  position: absolute;
  width: 248px;
  height: 248px;
  border: 1px solid #cecece;
  border-radius: 50%;
  right: 30px;
  top: 20px
}

.hero-art:after {
  content: '';
  position: absolute;
  height: 330px;
  width: 1px;
  background: #d0d0d0;
  transform: rotate(30deg);
  right: 150px;
  top: -20px
}

.word-paper {
  position: relative;
  width: 280px;
  background: #fcfcfc;
  border: 1px solid #d3d3d3;
  padding: 22px 24px;
  transform: rotate(-5deg);
  z-index: 1
}

.paper-meta {
  display: flex;
  justify-content: space-between;
  font-size: 7px;
  letter-spacing: 1.4px;
  color: #969696;
  margin-bottom: 22px
}

.word-paper .term {
  font-family: var(--serif);
  font-size: 35px;
  letter-spacing: -1px;
  line-height: 1.25
}

.word-paper .pronunciation {
  font-size: 9px;
  color: #969696;
  margin: 9px 0 12px
}

.word-paper .meaning {
  font-size: 11px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e4e4e4
}

.word-paper .sample {
  font-family: var(--serif);
  font-size: 11px;
  color: #808080;
  margin-top: 14px;
  line-height: 1.7
}

.word-paper .sample u {
  text-decoration-color: #9c9c9c;
  text-decoration-thickness: 3px;
  text-underline-offset: 3px
}

.paper-tag {
  position: absolute;
  right: -25px;
  bottom: 20px;
  background: var(--lime);
  color: #585858;
  padding: 9px 13px;
  transform: rotate(5deg);
  font-size: 9px;
  letter-spacing: .5px
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  background: var(--paper);
  margin-bottom: 28px
}

.stat {
  padding: 19px 22px;
  border-right: 1px solid var(--line)
}

.stat:last-child {
  border: 0
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #888888;
  font-size: 10px
}

.stat-top svg {
  width: 14px;
  height: 14px
}

.stat-number {
  font-size: 30px;
  font-weight: 400;
  letter-spacing: -1px;
  margin-top: 9px;
  line-height: 1.3
}

.stat-number small {
  font-size: 11px;
  margin-left: 6px;
  color: #888888;
  letter-spacing: 0
}

.stat-sub {
  font-size: 9px;
  color: #9a9a9a;
  margin-top: 5px
}

.dashboard-lower {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 276px;
  gap: 24px
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 15px
}

.section-title .eyebrow {
  margin: 0;
  font-size: 8px
}

.section-title h2 {
  font-size: 17px
}

.section-title>a {
  font-size: 10px;
  color: #777777
}

.panel {
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 23px
}

.empty-state {
  border: 1px dashed #d7d7d7;
  min-height: 182px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 25px;
  color: var(--muted);
  gap: 10px
}

.empty-state svg {
  color: #949494;
  width: 27px;
  height: 27px
}

.empty-state h3 {
  font-size: 14px;
  font-weight: 500;
  color: #5e5e5e
}

.empty-state p {
  font-size: 11px;
  max-width: 330px
}

.daily-panel {
  background: #fcfcfc
}

.daily-panel .section-title {
  margin-bottom: 22px
}

.daily-ring {
  display: flex;
  align-items: center;
  gap: 18px
}

.daily-ring .ring {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--green) var(--progress), #ebebeb 0);
  position: relative;
  flex-shrink: 0
}

.ring:before {
  content: '';
  position: absolute;
  inset: 6px;
  background: #fcfcfc;
  border-radius: 50%
}

.ring strong {
  position: relative;
  font-size: 21px;
  font-weight: 500
}

.daily-ring p {
  font-size: 10px;
  color: #888888
}

.daily-ring b {
  display: block;
  font-size: 12px;
  color: #606060;
  font-weight: 400;
  margin-bottom: 3px
}

.daily-line {
  height: 1px;
  background: var(--line);
  margin: 22px 0
}

.quote {
  font-family: var(--serif);
  font-size: 18px;
  color: #797979;
  line-height: 1.55
}

.quote-caption {
  font-size: 9px;
  color: #989898;
  margin-top: 9px
}

.deck-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px
}

.deck-card {
  background: var(--paper);
  border: 1px solid var(--line);
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 221px;
  transition: transform .15s, border-color .15s;
  cursor: pointer
}

.deck-card:hover {
  transform: translateY(-2px);
  border-color: #a5a5a5
}

.deck-cover {
  height: 94px;
  padding: 17px 19px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  background: #ececec;
  color: #898989;
  position: relative;
  overflow: hidden
}

.deck-card:nth-child(3n+2) .deck-cover {
  background: #eceff3;
  color: #8899a5
}

.deck-card:nth-child(3n) .deck-cover {
  background: #eeeeee;
  color: #949494
}

.deck-cover .lang-letter {
  font-family: var(--serif);
  font-size: 58px;
  position: absolute;
  bottom: -15px;
  right: 15px;
  font-style: italic;
  color: currentColor;
  opacity: .4;
  line-height: 1
}

.deck-cover .deck-mode {
  font-size: 8px;
  letter-spacing: 1.5px
}

.deck-body {
  padding: 15px 19px;
  display: flex;
  flex-direction: column;
  flex: 1
}

.deck-body h3 {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px
}

.deck-body p {
  font-size: 9px;
  color: #989898
}

.deck-progress {
  height: 3px;
  background: #ebebeb;
  margin: 16px 0 8px
}

.deck-progress span {
  display: block;
  background: #969696;
  height: 100%;
  min-width: 0
}

.deck-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #888888;
  font-size: 9px
}

.deck-list {
  display: grid;
  gap: 10px
}

.deck-list .deck-card {
  min-height: 0;
  display: grid;
  grid-template-columns: 80px 1fr
}

.deck-list .deck-cover {
  height: 100%;
  min-height: 105px
}

.deck-list .deck-cover .lang-letter {
  font-size: 46px;
  right: 8px
}

.deck-list .deck-body {
  padding: 16px
}

.deck-list .deck-progress {
  margin: 11px 0 5px
}

.dashboard-decks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px
}

.import-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 24px
}

.tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  gap: 24px;
  margin-bottom: 24px
}

.tab {
  font-size: 12px;
  padding: 0 0 12px;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  color: #8c8c8c
}

.tab.active {
  border-color: var(--green);
  color: var(--green)
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 18px
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 18px
}

.field label,
.field-label {
  font-size: 11px;
  color: #6b6b6b
}

.field input,
.field select,
.field textarea,
.input {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  padding: 11px 12px;
  width: 100%;
  outline: none
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.input:focus {
  border-color: #8d8d8d
}

.field input::placeholder,
.field textarea::placeholder,
.input::placeholder {
  color: #b2b2b2
}

.field textarea {
  resize: vertical;
  min-height: 215px;
  line-height: 1.9;
  font-size: 13px
}

.field .hint,
.hint {
  font-size: 10px;
  color: #979797;
  line-height: 1.8
}

.dropzone {
  border: 1px dashed #b9b9b9;
  background: #f6f6f6;
  min-height: 215px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  cursor: pointer;
  padding: 25px;
  position: relative
}

.dropzone.drag {
  background: var(--lime-light);
  border-color: var(--green)
}

.dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%
}

.dropzone svg {
  width: 30px;
  height: 30px;
  color: #7e7e7e
}

.dropzone strong {
  font-size: 13px;
  font-weight: 500
}

.dropzone p {
  font-size: 10px;
  color: #939393
}

.mode-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 9px 0 20px
}

.mode-option {
  border: 1px solid var(--line);
  padding: 12px;
  background: #fff;
  cursor: pointer;
  text-align: left
}

.mode-option.active {
  border-color: #808080;
  background: #f1f1f1
}

.mode-option b {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #545454
}

.mode-option small {
  display: block;
  font-size: 9px;
  color: #969696;
  margin-top: 4px
}

.toggle-line {
  display: flex;
  gap: 11px;
  align-items: start;
  border-top: 1px solid var(--line);
  padding-top: 17px;
  margin: 17px 0 24px
}

.toggle-line input {
  accent-color: var(--green);
  margin-top: 4px
}

.toggle-line b {
  font-size: 12px;
  font-weight: 500
}

.toggle-line p {
  font-size: 10px;
  color: #8c8c8c;
  margin-top: 4px
}

.help-step {
  display: flex;
  gap: 13px;
  margin: 20px 0
}

.step-index {
  font-size: 12px;
  color: #a0a0a0;
  font-family: var(--serif);
  padding-top: 2px
}

.help-step h3 {
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 5px
}

.help-step p {
  font-size: 10px;
  color: #8c8c8c;
  line-height: 1.85
}

.sample-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  width: 100%;
  background: #fff;
  padding: 12px;
  text-align: left;
  margin-top: 10px;
  font-size: 11px
}

.sample-button small {
  display: block;
  font-size: 9px;
  color: #999999;
  margin-top: 4px
}

.notice {
  font-size: 11px;
  line-height: 1.85;
  padding: 12px 15px;
  border-left: 2px solid #a0a0a0;
  background: #ececec;
  color: #737373;
  margin: 15px 0
}

.notice.warn {
  background: #f2f2f2;
  border-color: #9e9e9e;
  color: #6d6d6d
}

.notice.error {
  background: #fcf0ed;
  border-color: #c58273;
  color: #a45c4f
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
  flex-wrap: wrap
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap
}

.search-field {
  position: relative;
  min-width: 200px
}

.search-field svg {
  position: absolute;
  top: 11px;
  left: 12px;
  width: 16px;
  height: 16px;
  color: #8b8b8b
}

.search-field input {
  padding-left: 37px;
  font-size: 12px
}

.select-small {
  border: 1px solid var(--line);
  background: white;
  color: #6e6e6e;
  font-size: 11px;
  padding: 9px;
  min-height: 39px;
  max-width: 250px
}

.pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  color: #828282;
  font-size: 9px;
  gap: 5px;
  padding: 3px 8px;
  white-space: nowrap
}

.pill.green {
  background: #ebebeb;
  border-color: #d8d8d8;
  color: #6f6f6f
}

.pill.orange {
  background: #efefef;
  border-color: #dadada;
  color: #808080
}

.pill.red {
  background: #f2f2f2;
  border-color: #dcdcdc;
  color: #8a8a8a
}

.word-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  background: #fff
}

.word-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  white-space: normal
}

.word-table th {
  font-size: 9px;
  color: #8a8a8a;
  font-weight: 400;
  background: #f9f9f9;
  padding: 12px 17px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap
}

.word-table td {
  padding: 13px 17px;
  border-bottom: 1px solid #ececec;
  font-size: 11px;
  vertical-align: middle;
  max-width: 300px
}

.word-table tr:last-child td {
  border: 0
}

.word-table tbody tr:hover {
  background: #fbfbfb
}

.word-term {
  font-family: var(--serif);
  font-size: 19px;
  color: #444444;
  cursor: pointer
}

.word-term.ja {
  font-family: var(--sans);
  font-size: 15px
}

.word-reading {
  font-size: 9px;
  color: #979797;
  margin-top: 3px
}

.word-meaning {
  color: #7c7c7c;
  line-height: 1.7
}

.word-actions {
  display: flex;
  justify-content: end;
  gap: 5px
}

.word-actions .icon-button {
  width: 27px;
  height: 27px
}

.word-actions svg {
  width: 14px;
  height: 14px
}

.word-star.active {
  color: #707070
}

.table-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 10px;
  color: #9b9b9b;
  margin-top: 14px
}

.dictionary-search {
  max-width: 720px;
  margin: 37px auto 24px
}

.dictionary-search form {
  display: flex;
  gap: 10px
}

.dictionary-search input {
  font-family: var(--serif);
  font-size: 22px;
  padding: 15px 18px;
  flex: 1;
  min-width: 0
}

.dictionary-search select {
  width: 90px;
  flex-shrink: 0
}

.dictionary-intro {
  text-align: center;
  margin-top: 55px
}

.dictionary-intro .big-letter {
  font-family: var(--serif);
  font-size: 100px;
  line-height: 1;
  color: #d6d6d6;
  letter-spacing: -7px
}

.dictionary-intro h2 {
  font-size: 17px;
  font-weight: 400;
  margin: 18px 0 10px
}

.dictionary-intro p {
  font-size: 11px;
  color: #929292
}

.suggestions {
  display: flex;
  justify-content: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 21px
}

.suggestion {
  border: 1px solid var(--line);
  background: white;
  font-size: 11px;
  color: #727272;
  padding: 6px 13px
}

.definition-card {
  max-width: 720px;
  margin: 20px auto;
  background: #fff;
  border: 1px solid var(--line);
  padding: 30px
}

.definition-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: start
}

.definition-card h2 {
  font-family: var(--serif);
  font-size: 38px;
  line-height: 1.4;
  font-weight: 400;
  letter-spacing: -.5px
}

.definition-card .phonetic {
  font-size: 12px;
  color: #979797;
  margin: 7px 0 20px
}

.definition-body {
  font-size: 14px;
  line-height: 2;
  white-space: pre-wrap;
  color: #646464;
  border-top: 1px solid var(--line);
  padding-top: 19px
}

.definition-source {
  font-size: 9px;
  color: #9b9b9b;
  margin-top: 22px
}

.study-layout {
  max-width: 900px;
  margin: auto
}

.study-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px
}

.study-count {
  font-size: 10px;
  color: #898989
}

.study-progress {
  height: 3px;
  background: #dfdfdf;
  margin-bottom: 25px
}

.study-progress span {
  height: 3px;
  display: block;
  background: var(--green);
  transition: width .3s
}

.study-modes {
  display: flex;
  gap: 5px;
  flex-wrap: wrap
}

.mode-tab {
  border: 1px solid transparent;
  background: none;
  padding: 7px 13px;
  font-size: 11px;
  color: #939393
}

.mode-tab.active {
  background: #fff;
  border-color: var(--line);
  color: var(--green)
}

.study-card {
  border: 1px solid var(--line);
  background: white;
  min-height: 385px;
  padding: 31px 45px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative
}

.study-meta {
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-size: 9px;
  letter-spacing: 1.3px;
  color: #a3a3a3;
  align-items: center
}

.study-term {
  font-size: 53px;
  font-family: var(--serif);
  line-height: 1.4;
  letter-spacing: -1px;
  margin: 35px 0 3px;
  overflow-wrap: anywhere
}

.study-term.ja {
  font-family: var(--sans);
  font-size: 37px
}

.study-reading {
  font-size: 12px;
  color: #9a9a9a;
  min-height: 24px
}

.study-instruction {
  font-size: 11px;
  color: #a6a6a6;
  margin: 24px 0 20px
}

.reveal-button {
  min-width: 160px;
  margin-top: 15px
}

.study-answer {
  border-top: 1px solid var(--line);
  padding: 23px 0 7px;
  width: 100%;
  margin-top: 23px
}

.study-meaning {
  font-size: 19px;
  color: #4f4f4f;
  white-space: pre-wrap
}

.study-example {
  font-family: var(--serif);
  font-size: 16px;
  color: #8b8b8b;
  max-width: 670px;
  line-height: 1.8;
  margin: 16px auto 5px
}

.study-source {
  font-size: 9px;
  color: #a4a4a4;
  margin-top: 10px
}

.study-input {
  font-family: var(--serif);
  font-size: 23px;
  text-align: center;
  border: 0;
  border-bottom: 1px solid #c3c3c3;
  width: min(100%, 390px);
  padding: 12px;
  outline: none;
  background: #fafafa
}

.study-result {
  font-size: 12px;
  margin: 10px 0 4px;
  color: #777777
}

.study-result.wrong {
  color: #8b8b8b
}

.ratings {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 18px
}

.rating {
  padding: 13px 8px;
  text-align: center;
  border: 1px solid var(--line);
  background: white;
  color: #666666;
  font-size: 12px
}

.rating:hover {
  background: var(--lime-light);
  border-color: #a4a4a4
}

.rating small {
  display: block;
  font-size: 9px;
  color: #a2a2a2;
  margin-top: 5px
}

.rating:first-child {
  color: #878787
}

.rating:last-child {
  color: #686868
}

.study-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 17px;
  color: #a3a3a3;
  font-size: 10px
}

.choice-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 20px 0 0;
  width: 100%;
  max-width: 600px
}

.choice-option {
  padding: 13px;
  border: 1px solid var(--line);
  background: #fafafa;
  color: #727272;
  text-align: left;
  font-size: 12px;
  line-height: 1.7
}

.choice-option.selected {
  border-color: #808080;
  background: #ececec
}

.choice-option.correct {
  border-color: #8b8b8b;
  background: #e7e7e7
}

.choice-option.wrong {
  border-color: #b2b2b2;
  background: #f1f1f1
}

.study-ready {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 23px
}

.ready-card {
  padding: 29px;
  background: #fff;
  border: 1px solid var(--line)
}

.ready-number {
  font-size: 52px;
  font-family: var(--serif);
  color: var(--green);
  line-height: 1.3;
  margin: 16px 0 6px
}

.ready-card>p {
  color: #8b8b8b;
  font-size: 11px;
  margin-bottom: 22px
}

.reader-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 20px;
  align-items: start
}

.reader-paper {
  background: white;
  border: 1px solid var(--line);
  padding: 33px 39px;
  min-height: 510px
}

.reader-paper h2 {
  font-size: 21px;
  margin-bottom: 10px
}

.reader-meta {
  font-size: 9px;
  color: #9a9a9a;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 17px
}

.reader-text {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 2.15;
  color: #5e5e5e;
  white-space: pre-wrap;
  overflow-wrap: anywhere
}

.reader-text.ja {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 2.3
}

.reader-text mark {
  background: #e6e6e6;
  color: inherit;
  border-bottom: 1px solid #b7b7b7;
  cursor: pointer;
  padding: 2px 0
}

.reader-text mark.familiar {
  background: transparent;
  border-color: transparent
}

.reader-text mark:hover {
  background: #cdcdcd
}

.reader-text.test mark {
  background: none;
  border: 0
}

.reader-side {
  position: sticky;
  top: 20px
}

.reader-side .panel {
  padding: 22px
}

.reader-side h3 {
  font-family: var(--serif);
  font-size: 26px;
  overflow-wrap: anywhere
}

.reader-side .meaning {
  font-size: 12px;
  color: #727272;
  margin: 18px 0;
  white-space: pre-wrap
}

.reader-side .context {
  font-size: 11px;
  color: #989898;
  border-top: 1px solid var(--line);
  padding-top: 17px;
  line-height: 1.9
}

.switch-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: #808080;
  cursor: pointer
}

.switch-label input {
  accent-color: var(--green)
}

.chart-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 20px;
  margin: 23px 0
}

.bar-chart {
  display: flex;
  align-items: end;
  height: 156px;
  gap: 12px;
  margin-top: 27px;
  padding-bottom: 22px;
  position: relative
}

.chart-bar {
  flex: 1;
  min-width: 0;
  position: relative;
  height: 100%;
  display: flex;
  align-items: end;
  justify-content: center
}

.chart-bar>i {
  display: block;
  width: 100%;
  max-width: 35px;
  background: #c2c2c2;
  min-height: 1px
}

.chart-bar>span {
  position: absolute;
  bottom: -22px;
  font-size: 8px;
  color: #9e9e9e
}

.chart-bar>b {
  position: absolute;
  font-size: 9px;
  font-weight: 400;
  color: #727272;
  bottom: calc(var(--height) + 5px)
}

.heatmap {
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  gap: 5px;
  margin-top: 25px
}

.heat-cell {
  aspect-ratio: 1;
  background: #ececec
}

.heat-cell.l1 {
  background: #d6d6d6
}

.heat-cell.l2 {
  background: #aaaaaa
}

.heat-cell.l3 {
  background: #767676
}

.heat-cell.l4 {
  background: #4a4a4a
}

.chart-note {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: #a1a1a1;
  margin-top: 15px
}

.metric-list {
  display: grid;
  gap: 17px;
  margin-top: 24px
}

.metric-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: #828282
}

.metric-item b {
  font-size: 20px;
  color: #5f5f5f;
  font-weight: 400
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 23px;
  align-items: start
}

.settings-grid .panel h2 {
  margin-bottom: 24px;
  font-size: 16px
}

.settings-grid .field textarea {
  min-height: 100px
}

.settings-grid .panel>p {
  font-size: 11px;
  color: #929292;
  line-height: 1.9;
  margin-bottom: 18px
}

.settings-grid .field {
  margin-bottom: 18px
}

.settings-grid .form-row .field {
  margin-bottom: 0
}

.settings-grid .panel.full {
  grid-column: 1/-1
}

.data-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap
}

.device-note {
  padding: 13px;
  border: 1px solid var(--line);
  font-size: 10px;
  color: #909090;
  margin-top: 18px
}

.ai-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 15px;
  font-size: 10px;
  color: #949494
}

.pagination {
  display: flex;
  gap: 5px
}

.app-footer {
  padding: 13px 43px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 15px;
  font-size: 8px;
  letter-spacing: 1.3px;
  color: #9b9b9b;
  height: 56px;
  align-items: center
}

.app-footer span:nth-child(2) {
  letter-spacing: 0;
  font-size: 9px
}

#mobile-nav {
  display: none
}

#toast-stack {
  position: fixed;
  right: 25px;
  bottom: 25px;
  z-index: 100;
  display: grid;
  gap: 10px;
  max-width: min(400px, calc(100vw - 40px))
}

.toast {
  background: var(--green);
  color: white;
  font-size: 12px;
  padding: 13px 19px;
  border-left: 3px solid var(--lime);
  animation: toast-in .2s ease-out
}

.toast.error {
  background: #666666;
  border-color: #c6c6c6
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

dialog {
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  width: min(590px, calc(100vw - 30px));
  max-height: 87vh
}

dialog::backdrop {
  background: rgba(36, 49, 30, .24);
  backdrop-filter: blur(3px)
}

.modal-head {
  padding: 22px 27px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px
}

.modal-head h2 {
  font-size: 17px
}

.modal-body {
  padding: 25px 27px
}

.modal-actions {
  display: flex;
  justify-content: end;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 17px 27px
}

.modal-body .field:last-child {
  margin-bottom: 0
}

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 400px;
  color: #949494;
  font-size: 12px
}

.spinner {
  height: 21px;
  width: 21px;
  border: 2px solid #e0e0e0;
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  display: inline-block
}

@keyframes spin {
  to {
    transform: rotate(360deg)
  }
}

.import-progress {
  padding: 35px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 17px
}

.import-progress h3 {
  font-size: 16px
}

.import-progress p {
  font-size: 11px;
  color: #8f8f8f
}

.skip-link {
  position: fixed;
  left: 10px;
  top: -100px;
  z-index: 200;
  padding: 9px;
  background: var(--lime);
  color: var(--green)
}

.skip-link:focus {
  top: 10px
}

.inline-code {
  font-family: monospace;
  font-size: 10px;
  background: #f0f0f0;
  padding: 2px 5px
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0
}

.form-error {
  font-size: 11px;
  color: var(--red);
  margin-bottom: 12px
}

.completion {
  padding: 45px;
  text-align: center;
  background: #fff;
  border: 1px solid var(--line)
}

.completion-icon {
  width: 65px;
  height: 65px;
  display: grid;
  place-items: center;
  background: var(--lime-light);
  margin: 0 auto 25px;
  color: #6b6b6b
}

.completion h2 {
  font-size: 26px;
  font-weight: 500
}

.completion p {
  font-size: 12px;
  color: #8e8e8e;
  margin: 12px 0 25px
}

.completion-stats {
  display: flex;
  justify-content: center;
  gap: 50px;
  margin: 24px 0 30px
}

.completion-stats b {
  display: block;
  font: 36px var(--serif);
  color: #555555
}

.completion-stats small {
  font-size: 10px;
  color: #999999
}

.deck-detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px
}

.deck-detail-header .icon-button {
  border: 1px solid var(--line)
}

.deck-detail-header h2 {
  font-size: 18px
}

.reading-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap
}

.wide-only {
  display: initial
}

.text-muted {
  color: var(--muted)
}

.mt20 {
  margin-top: 20px
}

.w100 {
  width: 100%
}

.file-name {
  font-size: 11px;
  color: #6e6e6e;
  word-break: break-all
}

.source-badge {
  font-size: 9px;
  color: #868686
}

.review-summary-note {
  max-width: 640px;
  margin: 18px auto 0;
  font-size: 10px;
  color: #959595;
  text-align: center
}

.floating-tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 15px
}

.read-notes {
  min-height: 90px !important
}

.key {
  font-size: 9px;
  border: 1px solid #e0e0e0;
  padding: 1px 5px;
  color: #a0a0a0;
  margin-left: 7px
}

.selected-count {
  font-size: 11px;
  color: #8c8c8c
}

.word-table input[type=checkbox] {
  accent-color: var(--green)
}

.bulk-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  background: #ebebeb;
  border: 1px solid #d6d6d6;
  padding: 10px 14px;
  margin-bottom: 15px;
  flex-wrap: wrap
}

.page-size {
  font-size: 10px;
  color: #8e8e8e
}

.lang-note {
  font-size: 10px;
  padding: 10px 13px;
  background: #eeeeee;
  color: #7f7f7f;
  margin: 12px 0
}

.source-pages {
  font-size: 9px;
  letter-spacing: 1px;
  color: #9e9e9e;
  margin: 20px 0 10px;
  display: flex;
  align-items: center;
  gap: 12px
}

.source-pages:after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line)
}

.dictionary-results {
  max-width: 720px;
  margin: auto
}

.settings-grid .field .hint {
  margin-top: 1px
}

.no-result {
  font-size: 13px;
  color: #8c8c8c;
  text-align: center;
  padding: 45px 20px
}

.mobile-brand {
  display: none
}

.check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #848484
}

.check-item input {
  accent-color: var(--green)
}

@media(min-width:1600px) {
  :root {
    --sidebar: 244px
  }

  .hero {
    min-height: 285px
  }

  .hero-copy {
    padding: 38px 40px
  }

  .hero h2 {
    font-size: 45px
  }

  .hero-art .word-paper {
    width: 325px;
    padding: 24px 30px
  }

  .word-paper .term {
    font-size: 39px
  }
}

@media(max-width:1180px) {
  :root {
    --sidebar: 196px
  }

  .sidebar {
    padding: 28px 15px
  }

  .brand {
    gap: 8px;
    font-size: 17px
  }

  .brand b {
    font-size: 13px
  }

  .brand small {
    font-size: 9px
  }

  .topbar {
    margin: 0 28px
  }

  #main {
    padding: 28px
  }

  .app-footer {
    padding: 13px 28px
  }

  .hero-copy {
    padding: 26px
  }

  .hero h2 {
    font-size: 32px
  }

  .hero-art .word-paper {
    width: 232px;
    padding: 18px
  }

  .word-paper .term {
    font-size: 29px
  }

  .dashboard-lower {
    grid-template-columns: 1fr 235px;
    gap: 18px
  }

  .panel {
    padding: 20px
  }

  .deck-grid {
    grid-template-columns: repeat(2, 1fr)
  }

  .import-grid {
    grid-template-columns: 1fr 245px;
    gap: 18px
  }

  .reader-layout {
    grid-template-columns: 1fr 235px
  }

  .reader-paper {
    padding: 27px
  }

  .stat {
    padding: 17px
  }

  .hero {
    min-height: 240px
  }

  .word-table td,
  .word-table th {
    padding: 12px
  }

  .sidebar-bottom {
    padding-left: 7px;
    padding-right: 7px
  }
}

@media(max-width:950px) {
  :root {
    --sidebar: 174px
  }

  .sidebar {
    padding: 26px 12px
  }

  .brand b {
    display: none
  }

  .brand small {
    font-size: 8px
  }

  .workspace-label {
    font-size: 7px;
    letter-spacing: 1px
  }

  .nav-item {
    padding: 11px 10px;
    gap: 10px
  }

  .topbar {
    margin: 0 23px
  }

  .topbar-right {
    gap: 12px
  }

  #main {
    padding: 24px
  }

  .hero {
    grid-template-columns: 1.1fr 1fr
  }

  .hero-copy {
    padding: 23px
  }

  .hero h2 {
    font-size: 29px
  }

  .hero-art .word-paper {
    width: 205px
  }

  .word-paper .term {
    font-size: 26px
  }

  .paper-tag {
    right: -10px;
    font-size: 8px
  }

  .dashboard-lower {
    grid-template-columns: 1fr
  }

  .daily-panel {
    display: none
  }

  .import-grid {
    grid-template-columns: 1fr
  }

  .import-help {
    display: none
  }

  .reader-layout {
    grid-template-columns: 1fr
  }

  .reader-side {
    position: static
  }

  .settings-grid {
    grid-template-columns: 1fr
  }

  .settings-grid .panel.full {
    grid-column: auto
  }

  .stat-number {
    font-size: 27px
  }

  .stat {
    padding: 14px
  }

  .chart-grid {
    grid-template-columns: 1fr
  }

  .reader-paper {
    min-height: 0
  }

  .app-footer {
    padding: 13px 24px
  }

  .app-footer span:nth-child(2) {
    display: none
  }
}

@media(max-width:700px) {
  :root {
    --sidebar: 0px
  }

  .sidebar {
    display: none
  }

  .app-shell {
    margin-left: 0
  }

  .topbar {
    height: 61px;
    margin: 0 20px
  }

  .breadcrumb {
    font-size: 8px;
    gap: 10px;
    letter-spacing: 1px
  }

  .topbar-right {
    gap: 9px
  }

  #today-date {
    font-size: 8px
  }

  .avatar {
    width: 25px;
    height: 25px
  }

  .topbar-right .icon-button {
    width: 26px
  }

  .topbar-right .icon-button svg {
    width: 16px
  }

  #main {
    padding: 23px 20px 27px;
    min-height: calc(100vh - 178px)
  }

  .page-heading {
    margin-bottom: 22px;
    gap: 13px;
    align-items: start
  }

  .page-heading h1 {
    font-size: 26px
  }

  .page-heading p {
    font-size: 10px;
    line-height: 1.8;
    max-width: 245px
  }

  .page-heading .eyebrow {
    font-size: 8px;
    margin-bottom: 8px
  }

  .page-heading .btn {
    font-size: 10px;
    padding: 9px 12px;
    min-height: 35px
  }

  .page-heading .page-actions {
    align-self: end
  }

  .hero {
    min-height: 210px;
    grid-template-columns: 1.3fr 1fr;
    margin-bottom: 18px
  }

  .hero-copy {
    padding: 23px 20px
  }

  .hero h2 {
    font-size: 26px;
    line-height: 1.45
  }

  .hero .eyebrow {
    font-size: 6px;
    letter-spacing: 1.4px;
    margin-bottom: 13px
  }

  .hero p {
    font-size: 9px;
    line-height: 1.8;
    margin: 11px 0 16px;
    max-width: 210px
  }

  .hero .btn {
    font-size: 10px;
    min-height: 32px;
    padding: 8px 12px
  }

  .hero-art {
    margin-left: -10px;
    overflow: visible
  }

  .hero-art .word-paper {
    width: 171px;
    transform: rotate(-7deg);
    padding: 16px;
    margin-right: -15px
  }

  .paper-meta {
    font-size: 5px;
    margin-bottom: 16px;
    letter-spacing: 1px
  }

  .word-paper .term {
    font-size: 24px
  }

  .word-paper .pronunciation {
    font-size: 7px;
    margin: 7px 0 9px
  }

  .word-paper .meaning {
    font-size: 8px;
    padding-bottom: 10px
  }

  .word-paper .sample {
    font-size: 8px;
    margin-top: 11px
  }

  .paper-tag {
    padding: 7px 10px;
    font-size: 6px;
    right: -7px;
    bottom: 16px
  }

  .hero-art:before {
    width: 185px;
    height: 185px;
    right: -30px;
    top: 20px
  }

  .hero-art:after {
    right: 60px
  }

  .stat-row {
    grid-template-columns: repeat(2, 1fr);
    margin-bottom: 24px
  }

  .stat {
    padding: 15px 17px
  }

  .stat:nth-child(2) {
    border-right: 0
  }

  .stat:nth-child(-n+2) {
    border-bottom: 1px solid var(--line)
  }

  .stat-number {
    font-size: 28px;
    margin-top: 7px
  }

  .stat-sub {
    font-size: 8px
  }

  .stat-top {
    font-size: 9px
  }

  .dashboard-decks {
    grid-template-columns: 1fr 1fr;
    gap: 10px
  }

  .deck-cover {
    padding: 14px;
    height: 80px
  }

  .deck-cover .lang-letter {
    font-size: 51px
  }

  .deck-cover .deck-mode {
    font-size: 7px
  }

  .deck-body {
    padding: 14px
  }

  .deck-body h3 {
    font-size: 12px
  }

  .deck-body p {
    font-size: 8px
  }

  .deck-card {
    min-height: 200px
  }

  .deck-progress {
    margin: 13px 0 7px
  }

  .deck-foot {
    font-size: 8px
  }

  .section-title h2 {
    font-size: 16px
  }

  .section-title>a {
    font-size: 9px
  }

  .section-title {
    gap: 10px
  }

  .section-title .eyebrow {
    font-size: 7px
  }

  .app-footer {
    padding: 13px 20px;
    margin-bottom: 62px;
    height: 45px
  }

  #mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 65px;
    z-index: 30;
    background: rgba(255, 255, 252, .97);
    border-top: 1px solid var(--line);
    padding: 5px 10px max(5px, env(safe-area-inset-bottom));
    justify-content: space-around;
    align-items: center
  }

  #mobile-nav a {
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 4px;
    font-size: 8px;
    color: #9c9c9c;
    padding: 4px 15px
  }

  #mobile-nav a svg {
    width: 19px;
    height: 19px
  }

  #mobile-nav a.active {
    color: var(--green)
  }

  #toast-stack {
    bottom: 80px;
    right: 15px;
    max-width: calc(100vw - 30px)
  }

  .toast {
    font-size: 11px
  }

  .panel {
    padding: 20px
  }

  .form-row {
    gap: 13px
  }

  .field input,
  .field select {
    font-size: 12px
  }

  .field textarea {
    font-size: 12px;
    min-height: 230px
  }

  .mode-options {
    gap: 7px
  }

  .mode-option {
    padding: 11px 8px
  }

  .mode-option b {
    font-size: 11px
  }

  .mode-option small {
    font-size: 8px
  }

  .tabs {
    gap: 24px
  }

  .dropzone {
    min-height: 230px
  }

  .deck-grid {
    gap: 11px
  }

  .toolbar {
    gap: 12px
  }

  .toolbar-left,
  .toolbar-right {
    gap: 7px
  }

  .search-field {
    min-width: 0;
    flex: 1
  }

  .toolbar-left {
    flex: 1
  }

  .toolbar-left .select-small {
    max-width: 100px
  }

  .toolbar-right .btn {
    font-size: 10px;
    padding: 9px
  }

  .word-table th {
    font-size: 8px;
    padding: 10px
  }

  .word-table td {
    padding: 12px 10px;
    font-size: 10px;
    min-width: 85px
  }

  .word-table td:first-child {
    min-width: 26px
  }

  .word-table .word-term {
    font-size: 17px
  }

  .word-table .word-term.ja {
    font-size: 13px
  }

  .word-table .word-reading {
    font-size: 8px
  }

  .word-table .wide-only {
    display: none
  }

  .word-table .word-actions {
    min-width: 62px
  }

  .word-table .pill {
    font-size: 8px;
    padding: 2px 5px
  }

  .table-bottom {
    font-size: 9px;
    align-items: start
  }

  .dictionary-search {
    margin-top: 24px
  }

  .dictionary-search form {
    gap: 7px;
    flex-wrap: wrap
  }

  .dictionary-search input {
    padding: 13px;
    font-size: 19px;
    min-width: 140px
  }

  .dictionary-search select {
    width: 72px
  }

  .dictionary-search .btn {
    padding: 10px 12px
  }

  .dictionary-intro {
    margin-top: 43px
  }

  .dictionary-intro .big-letter {
    font-size: 83px
  }

  .dictionary-intro p {
    font-size: 10px;
    line-height: 1.9
  }

  .definition-card {
    padding: 23px
  }

  .definition-card h2 {
    font-size: 31px;
    overflow-wrap: anywhere
  }

  .definition-body {
    font-size: 12px
  }

  .study-ready {
    grid-template-columns: 1fr
  }

  .ready-card {
    padding: 25px
  }

  .ready-number {
    font-size: 46px
  }

  .study-card {
    padding: 24px 21px;
    min-height: 370px
  }

  .study-term {
    font-size: 40px;
    margin-top: 39px
  }

  .study-term.ja {
    font-size: 28px
  }

  .study-meta {
    font-size: 8px;
    letter-spacing: 1px
  }

  .study-meaning {
    font-size: 16px
  }

  .study-example {
    font-size: 14px
  }

  .study-instruction {
    font-size: 10px
  }

  .ratings {
    gap: 7px
  }

  .rating {
    font-size: 11px;
    padding: 12px 5px
  }

  .rating small {
    font-size: 8px
  }

  .study-top {
    align-items: start;
    margin-bottom: 18px
  }

  .study-modes {
    gap: 1px
  }

  .mode-tab {
    font-size: 10px;
    padding: 7px 8px
  }

  .study-count {
    font-size: 9px;
    white-space: nowrap;
    padding-top: 7px
  }

  .study-footer {
    font-size: 9px
  }

  .study-footer .key {
    display: none
  }

  .choice-options {
    grid-template-columns: 1fr;
    gap: 8px
  }

  .choice-option {
    padding: 11px;
    font-size: 11px
  }

  .study-input {
    font-size: 20px;
    max-width: 100%
  }

  .reader-paper {
    padding: 24px
  }

  .reader-paper h2 {
    font-size: 18px
  }

  .reader-text {
    font-size: 17px;
    line-height: 2
  }

  .reader-text.ja {
    font-size: 15px
  }

  .reading-controls {
    gap: 10px
  }

  .reader-layout {
    gap: 16px
  }

  .reader-side .panel {
    padding: 23px
  }

  .reader-side h3 {
    font-size: 23px
  }

  .reader-meta {
    margin-bottom: 22px
  }

  .reader-layout .reader-side {
    order: -1
  }

  .reader-side .context {
    display: none
  }

  .reader-side .meaning {
    margin: 10px 0
  }

  .reader-side .floating-tools {
    margin-top: 10px
  }

  .chart-grid {
    gap: 16px;
    margin: 18px 0
  }

  .chart-bar {
    gap: 9px
  }

  .heatmap {
    gap: 4px
  }

  .settings-grid {
    gap: 18px
  }

  .settings-grid .panel h2 {
    font-size: 16px;
    margin-bottom: 22px
  }

  .page-actions>.wide-only {
    display: none
  }

  .modal-head {
    padding: 18px 21px
  }

  .modal-body {
    padding: 20px 21px
  }

  .modal-actions {
    padding: 14px 21px
  }

  .completion {
    padding: 34px 22px
  }

  .completion h2 {
    font-size: 23px
  }

  .completion-stats {
    gap: 35px
  }

  .completion-stats b {
    font-size: 31px
  }

  .data-buttons {
    gap: 8px
  }

  .data-buttons .btn {
    font-size: 10px
  }

  .deck-detail-header h2 {
    font-size: 16px
  }

  .bulk-actions {
    gap: 7px;
    padding: 10px
  }

  .bulk-actions .btn {
    font-size: 9px;
    padding: 5px 8px
  }

  .bulk-actions .selected-count {
    width: 100%
  }

  .source-pages {
    font-size: 8px
  }
}

@media(max-width:380px) {
  #main {
    padding: 21px 16px
  }

  .hero h2 {
    font-size: 23px
  }

  .hero-copy {
    padding: 21px 17px
  }

  .hero-art .word-paper {
    width: 150px
  }

  .hero p {
    max-width: 170px
  }

  .word-paper .term {
    font-size: 21px
  }

  .word-paper .sample {
    font-size: 7px
  }

  .hero .btn {
    padding: 7px 10px
  }

  .hero {
    grid-template-columns: 1.3fr 1fr
  }

  .page-heading h1 {
    font-size: 24px
  }

  .topbar {
    margin: 0 16px
  }

  #today-date {
    display: none
  }

  .toolbar-right {
    width: 100%
  }

  .ratings {
    gap: 5px
  }

  .rating small {
    font-size: 7px
  }

  .rating {
    font-size: 10px
  }
}

@media(prefers-reduced-motion:reduce) {

  *,
  *:before,
  *:after {
    animation-duration: .01ms !important;
    transition: none !important;
    scroll-behavior: auto !important
  }
}

.btn {
  white-space: nowrap
}

@media(max-width:700px) {
  .page-heading {
    flex-direction: column;
    align-items: stretch;
    gap: 12px
  }

  .page-heading>div:first-child {
    min-width: 0;
    width: 100%
  }

  .page-heading .page-actions {
    align-self: flex-end
  }

  .page-heading h1 {
    font-size: 25px;
    letter-spacing: -.8px
  }

  .page-heading p {
    max-width: 100%
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: 239px
  }

  .hero-copy {
    padding: 24px 22px
  }

  .hero h2 {
    font-size: 28px;
    line-height: 1.48
  }

  .hero p {
    max-width: 100%;
    font-size: 10px;
    margin: 12px 0 17px
  }

  .hero-art {
    display: none
  }

  .hero .eyebrow {
    font-size: 7px
  }

  .hero .btn {
    min-height: 35px;
    font-size: 11px
  }

  .word-actions {
    flex-wrap: nowrap
  }
}
