/* The listening room uses the same sleeve ink, stock and racing stripe as Shelf. */
.tape-room {
  --tr-ink: #1d372e;
  --tr-paper: #faf5e9;
  --tr-muted: #526357;
  --tr-rule: #c4c6b5;
  --tr-red: #a33223;
  --tr-gold: #f4d393;
  color: var(--tr-ink);
  background: var(--tr-paper);
  width: 100%;
  min-height: 100dvh;
  line-height: 1.4;
}
.tape-room *, .tape-room *::before, .tape-room *::after { box-sizing: border-box; }
.tape-room [hidden] { display: none !important; }
.tape-room h1, .tape-room h2, .tape-room h3, .tape-room p, .tape-room button { margin: 0; }
.tape-room svg { width: 22px; height: 22px; flex: none; display: block; }
.tape-room a { color: inherit; text-underline-offset: 3px; }
.tape-room button, .tape-room summary { color: inherit; font: inherit; cursor: pointer; }
.tape-room button { border: 0; background: transparent; padding: 0; }
.tape-room button:disabled { cursor: default; opacity: .66; }
.tape-room :is(a, button, summary, [tabindex]):focus-visible { outline: 3px solid #3278ac; outline-offset: -3px; }
.tr-nav { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--tr-rule); min-height: 54px; padding: 2px max(20px, calc((100% - 1190px)/2)); }
.tr-nav a { display: inline-flex; gap: 7px; align-items:center; min-height: 44px; text-decoration: none; font-weight: 700; font-size: 15px; }
.tr-nav a:hover { text-decoration: underline; }
.tr-nav a:first-child svg { width: 18px; }
.tr-layout {
  display: grid;
  grid-template-areas: "music sheet" "lookup sheet";
  grid-template-columns: minmax(0,1fr) minmax(0,1.08fr);
  grid-template-rows: auto minmax(0,1fr);
  gap: 14px 22px;
  max-width: 1240px;
  margin: auto;
  padding: 18px 24px;
  height: calc(100dvh - 55px);
  min-height: 540px;
}
.tr-music { grid-area: music; min-width: 0; }
.tr-video { width:100%; position: relative; overflow:hidden; aspect-ratio: 16/9; min-height: 200px; border-radius: 3px 3px 0 0; background:#16251f; }
.tr-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.tr-title { display: flex; align-items:center; justify-content:space-between; position:relative; isolation:isolate; overflow: hidden; background: var(--tr-red); color: var(--tr-paper); padding: 9px 15px 12px; min-height: 76px; border-radius: 0 0 3px 3px; box-shadow: 0 2px #c2b89f; }
.tr-title >div { min-width:0; }
.tr-title small { color: var(--tr-gold); font-weight: 770; font-size: 12px; }
.tr-title h1 { overflow-wrap:anywhere; font: italic 700 clamp(29px,3.6vw,46px)/1.05 Georgia,serif; color: inherit; letter-spacing: -.055em; }
.tr-title i { position:absolute; inset:0 55px 0 auto; width:44px; z-index:-1; transform:skewX(-24deg); border-inline:4px solid #e8a45e; background:linear-gradient(90deg,transparent 0 19%,#e8a45e 19% 37%,transparent 37% 52%,#cd854f 52% 77%,transparent 77%); }
.tr-title a { width: 44px; height:44px; display:grid; place-items:center; flex:none; }
.tr-title a svg { width:23px; height:23px; padding:3px; background:var(--tr-gold); border-radius: 3px; }
.tr-alert { display:flex; flex-wrap:wrap; gap:8px; align-items:center; background:#f4e1c6; padding:9px 12px; border-left:3px solid var(--tr-red); font-size:13px; }
.tr-alert button { text-decoration:underline; font-weight:700; min-height:32px; }
.tr-sheet { grid-area:sheet; display:flex; flex-direction:column; min-height:0; overflow:hidden; border:1px solid var(--tr-rule); border-radius:3px; background:var(--tr-paper); }
.tr-heading { position:relative; z-index:2; display:flex; gap:8px; align-items:center; justify-content:space-between; border-bottom:1px solid var(--tr-rule); padding:4px 14px; }
.tr-heading h2 { font-size:25px; font-weight:820; line-height:1.2; letter-spacing:-.055em; color:var(--tr-ink); }
.tr-options, .tr-tabs { display:flex; align-items:center; gap:7px; }
.tr-options button, .tr-options summary { min-height:44px; font-size:13px; font-weight:650; }
.tr-options summary, .tr-context summary, .tr-foot summary { list-style:none; }
.tape-room summary::-webkit-details-marker { display:none; }
.tr-options summary { width:40px; display:grid; place-items:center; }
.tr-options details { position: relative; }
.tr-options button[data-ui=ipa] { display:inline-flex; align-items:center; gap:5px; }
.tr-options button[data-ui=ipa] i { position:relative; height:14px; width:24px; border-radius:12px; border:1px solid #829181; background:#e6e7d8; }
.tr-options button[data-ui=ipa] i::after { content:""; position:absolute; left:2px; top:2px; height:8px; width:8px; background:#667464; border-radius:100%; }
.tr-options button[data-ui=ipa][aria-pressed=true] i { background:var(--tr-ink); }
.tr-options button[data-ui=ipa][aria-pressed=true] i::after { left:12px; background:var(--tr-gold); }
.tr-menu { position:absolute; top:100%; right:0; min-width:145px; padding:4px 8px; color:var(--tr-ink); background:var(--tr-paper); box-shadow:2px 3px #344c3726; border:1px solid var(--tr-rule); border-radius:3px; }
.tr-menu button { display:flex; justify-content:space-between; align-items:center; width:100%; text-align:left; }
.tr-menu button[aria-pressed=true]::after { content:"✓"; }
.tr-lines { position:relative; flex:1; min-height:0; overflow-y:auto; overscroll-behavior:contain; scrollbar-width:thin; scrollbar-color:#a9b3a0 transparent; }
.tr-part { font-size:12px; font-weight:650; padding:13px 16px 4px; color:#665d4a; }
.tr-line { display:grid; grid-template-columns:44px minmax(0,1fr); gap:9px; padding:12px 15px 13px 8px; border-bottom:1px solid #dedfce; cursor:pointer; }
.tr-line.tr-singing { color:var(--tr-paper); background:var(--tr-ink); box-shadow:inset 4px 0 var(--tr-gold); }
.tr-stamp { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; min-width:44px; min-height:44px; align-self:start; color:var(--tr-muted); font-size:11px !important; font-variant-numeric:tabular-nums; }
.tr-stamp svg { height:16px; width:16px; }
.tr-singing .tr-stamp { color:var(--tr-gold); }
.tr-en { font-weight:700; font-size:clamp(18px,1.8vw,23px); line-height:1.4; letter-spacing:-.027em; overflow-wrap:anywhere; }
.tr-en .tr-word { display:inline; min-height:0; vertical-align:baseline; font:inherit; color:inherit; line-height:inherit; padding-block:1px; }
.tr-word[aria-pressed=true], .tr-word:hover { color:var(--tr-red); text-decoration:underline; text-underline-offset:3px; }
.tr-singing .tr-word[aria-pressed=true], .tr-singing .tr-word:hover { color:var(--tr-gold); }
.tape-room .tr-vi { font-size:14px; margin-top:3px; color:var(--tr-muted); }
.tr-singing .tr-vi { color:#d5e1cd; }
.tr-line-ipa, .tr-pronunciation { font:400 15px/1.45 Arial,sans-serif; }
.tr-line-ipa { display:none; overflow-wrap:anywhere; color:#44644f; }
.tr-singing .tr-line-ipa { color:var(--tr-gold); }
.tr-full-ipa .tr-line-ipa, .tr-selected .tr-line-ipa { display:block; }
.tr-hide-translation .tr-vi { display:none; }
.tr-line .tr-pattern { display:inline-flex; align-items:center; gap:5px; padding:4px 8px; min-height:36px; margin-top:7px; border:1px solid currentColor; border-radius:3px; font-weight:650; font-size:12px; }
.tr-pattern svg { width:17px; height:17px; }
.tr-studying .tr-pattern { display:none; }
.tr-foot { position:relative; display:flex; align-items:center; gap:9px; min-height:36px; padding:2px 12px; border-top:1px solid var(--tr-rule); font-size:12px; color:var(--tr-muted); }
.tr-foot time { color:var(--tr-ink); font-weight:700; font-variant-numeric:tabular-nums; }
.tr-foot details { margin-left:auto; }
.tr-foot summary { padding:7px 0; }
.tr-foot details >div { position:absolute; bottom:100%; left:0; right:0; border-block:1px solid var(--tr-rule); background:var(--tr-paper); padding:12px; white-space:pre-line; overflow-wrap:anywhere; }
.tr-foot button { margin-left:auto; font-size:12px; padding:5px 8px; border:1px solid var(--tr-rule); border-radius:3px; min-height:30px; }
.tr-empty { max-width:400px; margin:30px auto; padding:8px 22px; }
.tr-empty >svg { width:41px; height:41px; margin-bottom:13px; }
.tr-empty h3 { font-size:22px; line-height:1.15; letter-spacing:-.03em; }
.tr-empty p { margin:8px 0 14px; color:var(--tr-muted); }
.tr-lookup { grid-area:lookup; align-self:start; overflow:auto; max-height:100%; background:#f2e7cd; border:1px solid #cdbf9c; border-radius:4px; min-height:0; padding:7px 15px 12px; }
.tr-tabs { border-bottom:1px solid #cdbf9c; gap:2px; }
.tr-tabs button, .tr-actions button, .tr-primary { display:inline-flex; align-items:center; justify-content:center; gap:6px; min-height:40px; }
.tr-tabs button { padding:5px 8px; font-size:13px; font-weight:650; border-bottom:2px solid transparent; }
.tr-tabs button[aria-pressed=true] { border-color:var(--tr-red); }
.tr-tabs button[data-ui=close] { margin-left:auto; min-width:44px; }
.tr-tabs svg,.tr-actions svg { width:19px; height:19px; }
.tr-definition { display:grid; gap:6px; padding-top:8px; }
.tr-word-head { display:flex; flex-wrap:wrap; align-items:baseline; gap:8px; }
.tr-term { font:italic 700 32px/1.12 Georgia,serif; letter-spacing:-.045em; overflow-wrap:anywhere; }
.tr-meaning { font-size:15px; }.tr-usage,.tr-context { font-size:13px; color:var(--tr-muted); }
.tr-context summary { cursor:pointer; min-height:32px; padding:5px 0; }
.tr-context summary::after { content:"⌄"; margin-left:5px; }.tr-context[open] summary::after { content:"⌃"; }
.tr-actions { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
.tr-actions button,.tape-room .tr-primary { padding:8px 13px; border:1px solid #8c977e; border-radius:3px; font-size:13px; font-weight:700; }
.tape-room .tr-primary { background:var(--tr-ink); color:var(--tr-paper); border-color:var(--tr-ink); }
.tr-actions button:disabled { color:var(--tr-ink); background:#d8e5cd; opacity:1; }
.tr-actions .tr-save-error { color:var(--tr-red); font-size:13px; }
.tr-sr { position:absolute; clip-path:inset(50%); width:1px; height:1px; overflow:hidden; }
@media(max-width:760px) {
  .tape-room { height:100dvh; display:flex; flex-direction:column; }
  .tr-nav { flex:none; min-height:46px; padding:0 13px; }
  .tr-layout { display:flex; flex-direction:column; flex:1; width:100%; min-height:0; padding:0; gap:0; }
  .tr-music { width:100%; flex:none; }
  .tr-video { max-height:30dvh; border-radius:0; }
  .tr-title { min-height:58px; padding:5px 15px 7px; box-shadow:none; border-radius:0; }
  .tr-title h1 { font-size:clamp(24px,7vw,33px); }
  .tr-title small { font-size:10px; }
  .tr-sheet { flex:1; border:0; border-radius:0; }
  .tr-heading { padding-block:0; }
  .tr-line { padding-block:9px; }
  .tr-lookup { align-self:stretch; max-height:37dvh; flex:none; border-top:2px solid var(--tr-ink); border-radius:7px 7px 0 0; padding:3px 14px max(8px,env(safe-area-inset-bottom)); }
  .tr-studying .tr-foot { display:none; }
}
@media(max-width:760px) and (max-height:650px) {
  .tape-room { min-height:100dvh; height:auto; }
  .tr-video { max-height:none; }
  .tr-sheet { flex:none; min-height:210px; height:45dvh; }
  .tr-lookup { max-height:58dvh; }
}
.tr-foot details >div >a { display:inline-block; margin-right:12px; padding-block:4px; }
.tr-alert a { display:inline-flex; gap:5px; align-items:center; min-height:36px; font-weight:700; white-space:nowrap; }
.tr-alert a svg{width:16px;height:16px}

.tape-room .tr-dictionary { display:inline-flex; align-items:center; gap:6px; color:inherit; font-size:.9rem; text-underline-offset:3px; }
.tr-dictionary svg { width:17px; height:17px; }
.tape-room .tr-pref-error { max-width:13rem; font-size:.8rem; color:#8b2c24; }
