/* dashboard.css — shared styles for login/teacher/admin pages + components
   (toast, modal, header, cards, forms). Loaded alongside styles.css.

   Design tokens live here in :root and inherit through to all pages.
*/

:root {
  /* Pink shiba palette — used everywhere as the brand default */
  --c-primary:       #FF6FA3;
  --c-primary-deep:  #E94F88;
  --c-primary-soft:  #FFD6E5;
  --c-accent:        #FFC93C;
  --c-accent-soft:   #FFE9A8;

  --c-bg:            #FBF6F2;
  --c-bg-tinted:     radial-gradient(120% 80% at 50% 0%, #FFEFF6 0%, #FFF6F0 55%, #FBF6F2 100%);
  --c-card:          #FFFFFF;
  --c-card-border:   #FFD5E3;
  --c-card-shadow:   0 12px 32px -16px rgba(120, 60, 90, 0.22);

  --c-text:          #3A1F2B;
  --c-text-2:        #5A2E48;
  --c-text-soft:     #9A6F86;
  --c-text-mute:     #B9A0AC;

  --c-success:       #2DB67A;
  --c-success-soft:  #C8F0D9;
  --c-danger:        #E5484D;
  --c-danger-soft:   #FFD8DA;
  --c-warn:          #F58A2E;

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;

  --shadow-press:    0 6px 0 var(--c-primary-deep);
  --shadow-press-sm: 0 4px 0 var(--c-primary-deep);
}

html, body { margin: 0; padding: 0; }
body {
  font-family: 'Noto Sans TC', 'Noto Sans JP', system-ui, -apple-system, sans-serif;
  color: var(--c-text);
  background: var(--c-bg-tinted);
  background-attachment: fixed;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
  /* respect iOS safe areas at top/bottom */
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  box-sizing: border-box;
}
*, *::before, *::after { box-sizing: border-box; }

/* =========================================================================
   APP LAYOUT — single-column, max-width 720, centered. Mobile-first.
   ========================================================================= */
.app-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 16px 60px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.app-page.wide { max-width: 960px; }

.app-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.85);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-radius: var(--r-lg);
  border: 1.5px solid var(--c-card-border);
  box-shadow: var(--c-card-shadow);
  position: sticky;
  top: 8px;
  z-index: 50;
}
.app-header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
}
.app-header-logo {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--c-primary-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex: 0 0 auto;
}
.app-header-text { min-width: 0; }
.app-header-title {
  font-family: 'Fredoka', 'Noto Sans TC', sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--c-primary-deep);
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-header-sub {
  font-size: 11.5px;
  color: var(--c-text-soft);
  font-weight: 600;
  margin-top: 1px;
}
.app-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}
.app-header-user {
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text-2);
  white-space: nowrap;
}

/* =========================================================================
   CARDS
   ========================================================================= */
.card {
  background: var(--c-card);
  border-radius: var(--r-xl);
  border: 1.5px solid var(--c-card-border);
  padding: 18px 18px 20px;
  box-shadow: var(--c-card-shadow);
}
.card + .card { margin-top: 0; }
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.card-head-text { flex: 1 1 auto; min-width: 0; }
.card-title {
  font-family: 'Noto Sans TC', sans-serif;
  font-weight: 700;
  font-size: 17px;
  color: var(--c-text);
  margin: 0 0 2px;
  line-height: 1.25;
}
.card-subtitle {
  font-size: 12.5px;
  color: var(--c-text-soft);
  font-weight: 500;
  line-height: 1.5;
}
.card-head-extra { flex: 0 0 auto; }
.card-head-toggle {
  background: none;
  border: 0;
  padding: 0;
  width: 100%;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 0;
}
.card-head-toggle:hover .card-title { color: var(--c-primary); }
.card-toggle-chevron {
  display: inline-block;
  width: 1em;
  color: var(--c-text-soft);
  font-weight: 500;
  margin-right: 2px;
}

/* =========================================================================
   BUTTONS — chunky 3D press-down style
   ========================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: 'Noto Sans TC', sans-serif;
  font-weight: 700;
  font-size: 14.5px;
  border: none;
  border-radius: var(--r-md);
  padding: 11px 18px;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s, background .12s;
  text-align: center;
  white-space: nowrap;
  line-height: 1;
}
.btn:disabled, .btn.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--c-primary);
  color: white;
  box-shadow: 0 5px 0 var(--c-primary-deep);
}
.btn-primary:not(:disabled):active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 var(--c-primary-deep);
}
.btn-ghost {
  background: white;
  color: var(--c-text-2);
  border: 1.5px solid var(--c-card-border);
  box-shadow: 0 3px 0 var(--c-card-border);
}
.btn-ghost:not(:disabled):active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--c-card-border);
}
.btn-danger {
  background: var(--c-danger);
  color: white;
  box-shadow: 0 5px 0 #b53138;
}
.btn-danger:not(:disabled):active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #b53138;
}
.btn-small {
  padding: 7px 12px;
  font-size: 12.5px;
  border-radius: 12px;
  box-shadow: 0 3px 0 var(--c-primary-deep);
}
.btn-small.btn-ghost { box-shadow: 0 2px 0 var(--c-card-border); }
.btn-block { width: 100%; }
.btn-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1.5px solid var(--c-card-border);
  background: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  color: var(--c-text-2);
  transition: background .12s, transform .12s;
}
.btn-icon:hover { background: var(--c-primary-soft); }
.btn-icon:active { transform: scale(0.94); }

/* =========================================================================
   FORM FIELDS
   ========================================================================= */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--c-text-2);
  padding-left: 4px;
  letter-spacing: 0.02em;
}
.field-hint {
  font-size: 11.5px;
  color: var(--c-text-soft);
  padding-left: 4px;
  line-height: 1.5;
}
.field-input,
.field-select {
  font: inherit;
  font-family: 'Noto Sans TC', 'Noto Sans JP', sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--c-text);
  background: white;
  border: 1.5px solid var(--c-card-border);
  border-radius: 14px;
  padding: 12px 14px;
  outline: none;
  transition: border-color .12s, box-shadow .12s;
  width: 100%;
}
.field-input::placeholder { color: var(--c-text-mute); }
.field-input:focus,
.field-select:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 4px var(--c-accent-soft);
}
.field-input.code-input {
  font-family: 'Fredoka', monospace;
  letter-spacing: 0.22em;
  font-size: 20px;
  text-align: center;
  text-transform: uppercase;
}
.field-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.field-row > .field-input,
.field-row > .field-select { flex: 1 1 auto; min-width: 0; }
.field-row > .btn { flex: 0 0 auto; }

/* password toggle */
.password-wrap {
  position: relative;
}
.password-wrap .field-input {
  padding-right: 50px;
}
.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 18px;
  color: var(--c-text-soft);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}
.password-toggle:hover { color: var(--c-text); background: var(--c-primary-soft); }

select.field-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%239A6F86' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* =========================================================================
   TOAST
   ========================================================================= */
.toast-host {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  pointer-events: none;
  width: max-content;
  max-width: calc(100vw - 32px);
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
  color: var(--c-text);
  font-size: 14px;
  font-weight: 600;
  padding: 11px 16px 11px 12px;
  border-radius: 18px;
  box-shadow: 0 14px 40px -10px rgba(0,0,0,0.25), 0 0 0 1.5px var(--c-card-border);
  pointer-events: auto;
  animation: toast-in .35s cubic-bezier(.3,1.4,.5,1);
  max-width: 92vw;
}
.toast-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: white;
  font-size: 13px;
  font-weight: 700;
  flex: 0 0 auto;
}
.toast-ok  .toast-icon { background: var(--c-success); }
.toast-err .toast-icon { background: var(--c-danger); }
.toast-info .toast-icon { background: var(--c-primary); }
.toast-msg { white-space: pre-wrap; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =========================================================================
   MODAL
   ========================================================================= */
.modal-scrim {
  position: fixed; inset: 0;
  background: rgba(40, 25, 35, 0.42);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  animation: scrim-in .2s ease;
}
@keyframes scrim-in { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  background: white;
  border-radius: var(--r-xl);
  padding: 22px 22px 18px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 22px 60px -10px rgba(0,0,0,0.25);
  animation: modal-in .35s cubic-bezier(.3,1.4,.5,1);
  text-align: center;
}
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}
.modal-icon {
  font-size: 44px;
  margin-bottom: 8px;
  line-height: 1;
}
.modal-title {
  font-family: 'Noto Sans TC', sans-serif;
  font-weight: 700;
  font-size: 19px;
  color: var(--c-text);
  margin: 0 0 6px;
}
.modal-body {
  font-size: 14px;
  color: var(--c-text-soft);
  line-height: 1.6;
  margin: 0 0 18px;
  text-align: center;
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.modal-actions .btn { min-width: 96px; }
.modal-danger .modal-icon { color: var(--c-danger); }

/* prompt modal */
.prompt-wrap { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.prompt-help { font-size: 13px; color: var(--c-text-soft); text-align: center; }

/* =========================================================================
   MASCOT AVATAR
   ========================================================================= */
.mascot-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 3px solid;
  background: var(--c-primary-soft);
  flex: 0 0 auto;
  line-height: 1;
}

/* =========================================================================
   ROLE BADGE
   ========================================================================= */
.role-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.role-admin   { background: #E9DCFF; color: #5B3FA0; }
.role-teacher { background: #C8EFE3; color: #277B62; }
.role-student { background: #FFE0CB; color: #B25827; }

/* =========================================================================
   JOIN-CODE CHIP — big tappable display
   ========================================================================= */
.join-code {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: white;
  border: 2.5px dashed var(--c-primary-soft);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  cursor: pointer;
  transition: background .12s, border-color .12s;
  font-family: inherit;
}
.join-code:hover { border-color: var(--c-primary); background: #fffafc; }
.join-code-text {
  font-family: 'Fredoka', monospace;
  font-weight: 700;
  font-size: 34px;
  color: var(--c-primary-deep);
  letter-spacing: 0.18em;
  line-height: 1;
}
.join-code-hint {
  font-size: 11px;
  font-weight: 600;
  color: var(--c-text-soft);
  background: var(--c-primary-soft);
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0;
}
.join-code-sm .join-code-text { font-size: 22px; letter-spacing: 0.14em; }

/* =========================================================================
   EMPTY STATE
   ========================================================================= */
.empty-state {
  text-align: center;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.empty-state-glyph {
  font-size: 50px;
  filter: grayscale(0.2);
  opacity: 0.85;
  margin-bottom: 4px;
}
.empty-state-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--c-text-2);
}
.empty-state-body {
  font-size: 13px;
  color: var(--c-text-soft);
  max-width: 280px;
  line-height: 1.55;
}

/* =========================================================================
   PAGE LOADER (full-screen)
   ========================================================================= */
.page-loader {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: var(--c-bg-tinted);
}
.page-loader-mascot {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: #FFD8A8;
  border: 4px solid #FFB078;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 52px;
  animation: loader-bounce 1.4s ease-in-out infinite;
  position: relative;
}
.page-loader-mascot::after {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 4px dashed var(--c-primary);
  border-color: var(--c-primary) transparent var(--c-primary) transparent;
  animation: pa-spin 1.6s linear infinite;
}
.page-loader-text {
  font-weight: 600;
  color: var(--c-text-soft);
  font-size: 14px;
}
@keyframes loader-bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

/* =========================================================================
   LIST ITEMS (for student lists, teacher lists, account lists)
   ========================================================================= */
.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--r-md);
  background: #fff8fb;
  border: 1.5px solid transparent;
  transition: background .12s, border-color .12s;
}
.list-item + .list-item { margin-top: 8px; }
.list-item:hover { background: #fff0f6; border-color: var(--c-card-border); }
.list-item-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.list-item-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--c-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-item-sub {
  font-size: 12px;
  color: var(--c-text-soft);
  font-family: 'Fredoka', monospace;
  letter-spacing: 0.05em;
}
.list-item-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* compact "+ count" pill for date list */
.count-pill {
  font-size: 11px;
  font-weight: 700;
  background: var(--c-primary-soft);
  color: var(--c-primary-deep);
  padding: 3px 10px;
  border-radius: 999px;
}

/* =========================================================================
   LOGIN PAGE (auth)
   ========================================================================= */
.auth-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 18px;
}
.auth-card {
  width: 100%;
  max-width: 380px;
  background: white;
  border-radius: 32px;
  padding: 28px 24px 22px;
  box-shadow: 0 24px 60px -20px rgba(120, 60, 90, 0.28);
  border: 1.5px solid var(--c-card-border);
  text-align: center;
}
.auth-lockup {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  position: relative;
  width: 100px;
  height: 100px;
}
.auth-lockup-mascot {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: #FFD8A8;
  border: 5px solid #FFB078;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 54px;
  box-shadow: 0 12px 24px -8px rgba(0,0,0,0.18);
  animation: loader-bounce 3s ease-in-out infinite;
}
.auth-title {
  font-family: 'Fredoka', 'Noto Sans TC', sans-serif;
  font-weight: 700;
  font-size: 26px;
  color: var(--c-primary-deep);
  margin: 6px 0 4px;
}
.auth-sub {
  font-size: 13px;
  color: var(--c-text-soft);
  margin-bottom: 22px;
  font-weight: 500;
}
.auth-form { text-align: left; }
.auth-foot {
  margin-top: 18px;
  font-size: 12px;
  color: var(--c-text-soft);
  text-align: center;
  line-height: 1.6;
}

/* =========================================================================
   WORD EDITOR (teacher)
   ========================================================================= */
.word-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.word-row {
  display: grid;
  grid-template-columns: 28px 1fr 1fr 32px;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border-radius: 14px;
  background: #fff8fb;
  border: 1.5px solid var(--c-card-border);
  transition: border-color .12s, background .12s;
}
.word-row:focus-within {
  border-color: var(--c-primary);
  background: white;
}
.word-row-num {
  font-family: 'Fredoka', monospace;
  font-weight: 700;
  font-size: 14px;
  color: var(--c-primary-deep);
  text-align: center;
}
.word-row .field-input {
  padding: 9px 12px;
  font-size: 14px;
  border-radius: 10px;
}
.word-row-del {
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--c-text-mute);
  font-size: 16px;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.word-row-del:hover { color: var(--c-danger); background: var(--c-danger-soft); }
.word-add {
  margin-top: 4px;
  background: white;
  border: 2px dashed var(--c-card-border);
  color: var(--c-text-soft);
  padding: 10px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  width: 100%;
}
.word-add:hover { border-color: var(--c-primary); color: var(--c-primary-deep); }

.word-help {
  background: var(--c-accent-soft);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 12.5px;
  color: #6B4F12;
  line-height: 1.6;
  margin-bottom: 12px;
}
.word-help b { color: #4D3702; }
.word-help code {
  background: rgba(255,255,255,0.6);
  padding: 1px 6px;
  border-radius: 6px;
  font-family: 'Noto Sans JP', monospace;
  font-size: 12px;
}

/* Preview card mini */
.word-preview-wrap {
  background: var(--c-bg-tinted);
  border-radius: var(--r-xl);
  padding: 14px;
  border: 1.5px solid var(--c-card-border);
}
.word-preview-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--c-text-soft);
  font-weight: 600;
}
.word-preview-nav button {
  background: white;
  border: 1.5px solid var(--c-card-border);
  border-radius: 10px;
  width: 30px;
  height: 30px;
  font-size: 13px;
  cursor: pointer;
  color: var(--c-text-2);
}
.word-preview-nav button:disabled { opacity: 0.35; cursor: not-allowed; }
.word-preview-card {
  background: white;
  border-radius: 22px;
  padding: 22px 16px;
  text-align: center;
  border: 1.5px solid var(--c-card-border);
  min-height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.word-preview-jp {
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 900;
  color: var(--c-text);
  line-height: 1.15;
  text-wrap: balance;
}
.word-preview-jp ruby rt {
  font-size: 0.35em;
  font-weight: 600;
  color: var(--c-text-soft);
}
.word-preview-zh {
  border-top: 2px dotted var(--c-card-border);
  padding-top: 10px;
  width: 80%;
  font-weight: 700;
  color: var(--c-text-soft);
}
.word-preview-speak {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: none;
  background: var(--c-primary);
  color: white;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 5px 0 var(--c-primary-deep);
}
.word-preview-speak:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 var(--c-primary-deep);
}

/* =========================================================================
   DATE LIST (teacher)
   ========================================================================= */
.date-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #fff8fb;
  border: 1.5px solid transparent;
}
.date-list-item + .date-list-item { margin-top: 6px; }
.date-list-item:hover { background: #fff0f6; border-color: var(--c-card-border); }
.date-list-item-label {
  flex: 1 1 auto;
  font-weight: 700;
  font-size: 14px;
  color: var(--c-text);
}
.date-list-item-count {
  color: var(--c-text-soft);
  font-size: 12px;
  font-weight: 600;
}

/* =========================================================================
   FILTER BAR
   ========================================================================= */
.filter-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.filter-chip {
  background: white;
  border: 1.5px solid var(--c-card-border);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  color: var(--c-text-2);
  transition: background .12s, border-color .12s, color .12s;
}
.filter-chip[aria-current='true'],
.filter-chip:hover { background: var(--c-primary-soft); border-color: var(--c-primary); color: var(--c-primary-deep); }

/* =========================================================================
   Tablet & desktop refinements (touch-friendly sizing)
   ========================================================================= */
@media (min-width: 720px) {
  .app-page { padding: 24px 24px 80px; gap: 20px; }
  .app-header { padding: 12px 18px; }
  .card { padding: 24px; }
  .card-title { font-size: 19px; }
  .field-row.field-row-desktop { display: grid; grid-template-columns: 1fr 1fr; }

  /* Bigger word-editor rows so they're comfortable to tap on tablet */
  .word-row { grid-template-columns: 36px 1fr 1fr 40px; gap: 12px; padding: 10px; }
  .word-row .field-input { padding: 12px 14px; font-size: 15.5px; }
  .word-row-num { font-size: 16px; }
  .word-row-del { width: 36px; height: 36px; font-size: 18px; }
  .word-add { padding: 14px; font-size: 15px; }

  /* Bigger primary buttons so they fit fingers, not cursors */
  .btn { padding: 12px 20px; font-size: 15px; min-height: 46px; }
  .btn-small { padding: 9px 14px; font-size: 13.5px; min-height: 0; }
}

/* keyframes shared */
@keyframes pa-spin { to { transform: rotate(360deg); } }
