.study-sets-page { background: #f3fafb; color: var(--ink); min-height: 100vh; }
.study-sets-page .button--secondary { color: var(--ink); border-color: var(--line); background: #fff; }
.study-sets-page .button--secondary:hover { background: #fff2ef; }
.study-sets-page .primary-nav { display: flex; }
.study-sets-main { width: min(1100px, calc(100% - 32px)); margin: 0 auto; padding: 34px 0 80px; }
.study-sets-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 24px; }
.study-sets-header h1 { margin: 0 0 8px; font-size: clamp(1.7rem, 4vw, 2.6rem); }
.study-sets-header p { margin: 0; color: var(--muted); line-height: 1.5; }
.study-sets-panel { padding: clamp(18px, 3vw, 30px); margin: 0 0 20px; background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 12px 28px rgba(29,42,56,.06); }
.study-sets-panel h2 { margin: 0 0 12px; font-size: 1.35rem; }
.study-sets-panel p { line-height: 1.55; }
.study-sets-paste-panel { border-color: #b9ded9; background: linear-gradient(135deg, #fff 64%, #edfaf7); }
.study-sets-paste-intro { margin: 0 0 18px; color: var(--muted); }
.study-sets-import-panel { border-color: #b9ded9; background: linear-gradient(135deg, #fff 64%, #edfaf7); }
.study-sets-field-help { margin: -12px 0 0; color: var(--muted); font-size: .9rem; }
.study-sets-import-note { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: .92rem; }
.study-sets-import-note a { color: #206a68; font-weight: 800; }
.study-sets-import-note code { padding: 2px 5px; border-radius: 5px; background: #e9f5f3; color: var(--ink); }
.study-sets-import-actions { margin-top: 20px; }
.study-sets-howto__heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.study-sets-howto__heading h2 { margin-bottom: 0; }
.study-sets-howto__heading > span { flex: 0 0 auto; padding: 7px 11px; border-radius: 999px; background: #e7f6f2; color: #206a68; font-size: .83rem; font-weight: 800; }
.study-sets-howto__caption { margin: 8px 0 18px; color: var(--muted); font-size: .9rem; }
.study-sets-howto__skip { margin: -8px 0 22px; font-size: .9rem; }
.study-sets-howto__skip a { color: #206a68; font-weight: 800; }
.study-sets-howto__steps { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; }
.study-sets-howto__steps li { position: relative; min-width: 0; padding: 10px 12px 14px; border: 1px solid #d7e4e6; border-radius: 15px; background: #fff; }
.study-sets-howto__step-number { position: absolute; z-index: 1; top: -12px; left: 14px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #dc6a5e; color: #fff; font-size: .88rem; font-weight: 900; }
.study-sets-howto__steps li > strong { display: block; margin-top: 12px; line-height: 1.35; }
.study-sets-howto__steps li > p { margin: 5px 0 0; color: var(--muted); font-size: .86rem; line-height: 1.45; }
.study-sets-howto__visual { display: flex; flex-direction: column; justify-content: center; gap: 7px; height: 118px; overflow: hidden; padding: 16px 11px 10px; border: 1px solid #dbe9eb; border-radius: 10px; background: #f5fafb; color: #35414a; font-size: .7rem; }
.study-sets-howto__browser { display: flex; align-items: center; gap: 5px; min-width: 0; padding: 5px; border: 1px solid #d7e4e6; border-radius: 6px; background: #fff; white-space: nowrap; }
.study-sets-howto__browser span:last-child { overflow: hidden; text-overflow: ellipsis; }
.study-sets-howto__dots { flex: 0 0 auto; color: #d7776c; font-size: .52rem; letter-spacing: -1px; }
.study-sets-howto__mini-title { margin-top: 5px; font-weight: 800; }
.study-sets-howto__mini-line { width: 90%; height: 7px; border-radius: 4px; background: #d9e7e8; }
.study-sets-howto__mini-line--short { width: 62%; }
.study-sets-howto__visual--menu { position: relative; justify-content: flex-start; align-items: flex-end; padding-top: 14px; }
.study-sets-howto__menu-trigger { display: grid; place-items: center; width: 30px; height: 26px; border: 1px solid #cbd9dd; border-radius: 6px; background: #fff; font-weight: 900; letter-spacing: 2px; }
.study-sets-howto__menu-popover { display: grid; gap: 5px; width: min(145px, 86%); padding: 7px; border: 1px solid #d7e4e6; border-radius: 8px; background: #fff; box-shadow: 0 4px 12px rgba(29,42,56,.1); }
.study-sets-howto__menu-popover b { padding: 4px 5px; border-radius: 5px; background: #fff0ed; color: #9e4238; }
.study-sets-howto__visual--copy { gap: 5px; }
.study-sets-howto__pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px 7px; border: 1px solid #d7e4e6; border-radius: 5px; background: #fff; font-weight: 700; }
.study-sets-howto__pair span + span { border-left: 1px solid #cbd9dd; padding-left: 7px; }
.study-sets-howto__copy-chip { align-self: flex-end; padding: 4px 7px; border-radius: 5px; background: #dc6a5e; color: #fff; font-weight: 800; }
.study-sets-howto__visual--paste { gap: 3px; font-weight: 700; }
.study-sets-howto__mock-field { display: block; width: 100%; padding: 3px 6px; border: 1px solid #d7e4e6; border-radius: 5px; background: #fff; color: #66717a; font-weight: 400; }
.study-sets-howto__mock-action { align-self: flex-end; margin-top: 2px; padding: 3px 7px; border-radius: 5px; background: #dc6a5e; color: #fff; }
.study-sets-howto__fallback { display: grid; grid-template-columns: minmax(120px, 150px) minmax(0, 1fr) auto; align-items: center; gap: 16px; margin-top: 16px; padding: 14px 16px; border: 1px solid #a9d9d1; border-radius: 14px; background: #edfaf7; }
.study-sets-howto__fallback p { margin: 4px 0 0; color: var(--muted); font-size: .9rem; }
.study-sets-howto__fallback a:not(.button) { color: #206a68; font-weight: 800; }
.study-sets-howto__fallback-code { display: grid; gap: 4px; padding: 9px 10px; border-radius: 8px; background: #fff; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .75rem; }
.study-sets-optional { font-weight: 400; color: var(--muted); }
.study-sets-paste-form { gap: 8px; }
.study-sets-form.study-sets-paste-form label { display: block; }
.study-sets-paste-form input, .study-sets-paste-form textarea { margin-bottom: 8px; }
.study-sets-paste-form input:focus-visible, .study-sets-paste-form textarea:focus-visible { outline: 3px solid #7bcbc2; outline-offset: 2px; }
.study-sets-paste-help { margin: -8px 0 6px; color: var(--muted); font-size: .92rem; }
.study-sets-paste-form .study-sets-actions { margin-top: 2px; }
.study-sets-paste-form .button { min-height: 48px; }
.study-sets-form { display: grid; gap: 16px; }
.study-sets-form label { display: grid; gap: 7px; font-weight: 800; }
.study-sets-form input, .study-sets-form textarea, .study-sets-form select,
.study-sets-toolbar input, .study-sets-toolbar select, .study-set-row input[type="text"] { width: 100%; min-width: 0; padding: 11px 12px; border: 1px solid #cbd9dd; border-radius: 10px; background: #fff; color: var(--ink); font: inherit; }
.study-sets-form textarea { min-height: 190px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .9rem; }
.study-sets-help { color: var(--muted); font-size: .93rem; }
.study-sets-help summary { cursor: pointer; font-weight: 800; color: #206a68; }
.study-sets-actions, .study-sets-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.study-sets-toolbar { margin: 18px 0; }
.study-sets-toolbar input[type="search"] { flex: 1 1 220px; }
.study-sets-toolbar .button { min-height: 42px; }
.study-sets-status { min-height: 1.5em; font-weight: 700; color: #226d67; }
.study-sets-status[data-error="true"] { color: #ac3939; }
.study-set-list { display: grid; gap: 12px; }
.study-set-card { padding: 18px; border: 1px solid #d7e4e6; border-radius: 14px; background: #fff; display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.study-set-card h3 { margin: 0 0 5px; overflow-wrap: anywhere; }
.study-set-card p { margin: 0; color: var(--muted); }
.study-set-card small { display: block; margin-top: 5px; color: var(--muted); line-height: 1.45; }
.study-set-card--local { border-color: #a9d9d1; background: #fbfffe; }
.study-set-card__actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.study-set-row { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 12px; border: 1px solid #d7e4e6; border-radius: 12px; background: #fff; }
.study-set-row + .study-set-row { margin-top: 8px; }
.study-set-row .study-set-number { min-width: 2em; color: var(--muted); font-weight: 800; }
.study-set-row label { min-width: 0; }
.study-set-row input[type="checkbox"] { width: 20px; height: 20px; }
.study-set-row .button { padding: 9px 12px; min-height: 40px; }
.study-set-preview-scroll { max-height: min(58vh, 650px); overflow: auto; padding: 2px; }
.study-sets-pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 16px; }
.study-sets-pagination button { min-height: 40px; padding: 7px 14px; border: 1px solid #cbd9dd; border-radius: 9px; background: #fff; cursor: pointer; }
.study-sets-range-fields { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.study-sets-range-fields label { display: flex; align-items: center; gap: 7px; }
.study-sets-range-fields input { width: 75px; }
.study-sets-selected { max-height: 290px; overflow: auto; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-top: 10px; }
.study-sets-selected label { display: flex; gap: 9px; align-items: flex-start; padding: 8px; border: 1px solid #d7e4e6; border-radius: 9px; }
.study-sets-selected input { margin-top: 3px; }
[hidden] { display: none !important; }
@media (max-width: 960px) {
  .study-sets-howto__steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .study-sets-howto__fallback { grid-template-columns: minmax(120px, 150px) minmax(0, 1fr); }
  .study-sets-howto__fallback .button { grid-column: 2; justify-self: start; }
}
@media (max-width: 740px) {
  .study-sets-page .site-header { flex-wrap: wrap; }
  .study-sets-page .primary-nav { width: 100%; justify-content: center; padding: 0 10px 10px; gap: 12px; font-size: .85rem; }
  .study-sets-header, .study-set-card { display: grid; }
  .study-set-card__actions { width: 100%; }
  .study-set-card__actions .button { flex: 1 1 auto; }
  .study-set-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .study-set-row label[data-field="answer"] { grid-column: 2 / -1; }
  .study-sets-selected { grid-template-columns: 1fr; }
  .study-sets-main { width: min(100% - 20px, 1100px); padding-top: 18px; }
  .study-sets-paste-form .button { width: 100%; }
  .study-sets-howto__heading { align-items: flex-start; }
  .study-sets-howto__heading > span { display: none; }
  .study-sets-howto__steps, .study-sets-howto__fallback { grid-template-columns: 1fr; }
  .study-sets-howto__visual { height: 106px; }
  .study-sets-howto__fallback .button { grid-column: 1; width: 100%; }
}
