/* The one header and the one footer of every TEAR page (chrome.js fills them). Self-contained: no other stylesheet needed. */
#tear-head {
  position: sticky; top: 0; z-index: 40; box-sizing: border-box; height: 60px; margin: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left));
  background: #16161a; color: #fff; -webkit-font-smoothing: antialiased;
}
#tear-head .tear-word {
  display: inline-flex; align-items: center; min-height: 44px; color: #fff; text-decoration: none;
  font: 600 19px/1 "Iowan Old Style", "New York", Georgia, serif; letter-spacing: .2em;
}
#tear-head .tear-right { display: flex; align-items: center; gap: 10px; }
#tear-head .tear-actions { display: flex; align-items: center; gap: 8px; }
#tear-head .tear-actions:empty { display: none; }
#tear-head .tear-act {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, .22); border-radius: 6px; background: none; color: #fff; cursor: pointer; text-decoration: none;
  font: 600 14px/1 "Avenir Next", -apple-system, system-ui, sans-serif;
}
#tear-head .tear-act svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
#tear-head .tear-act[hidden] { display: none; }
#tear-head .tear-langs { display: flex; gap: 0; }
#tear-head .tear-langs button {
  min-width: 44px; min-height: 44px; padding: 7px 5px; border: 0; border-radius: 6px; background: none; background-clip: content-box; cursor: pointer;
  color: rgba(255, 255, 255, .6); font: 600 12.5px/1 "Avenir Next", -apple-system, system-ui, sans-serif; letter-spacing: .06em;
}
#tear-head .tear-langs button:hover { color: #fff; }
#tear-head .tear-langs button[aria-pressed="true"] { background-color: #f3f1eb; color: #16161a; }
#tear-head .tear-signout { display: flex; margin: 0; }

/* A phone (360-480 px): the wordmark, the actions, the switch and sign-out on one line. */
@media (max-width: 480px) {
  #tear-head { gap: 8px; padding: 0 max(14px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left)); }
  #tear-head .tear-word { font-size: 17px; letter-spacing: .14em; }
  #tear-head .tear-right, #tear-head .tear-actions { gap: 6px; }
  #tear-head .tear-act { gap: 6px; padding: 0 10px; font-size: 13px; }
  #tear-head .tear-act .tear-label { max-width: 7em; white-space: normal; font-size: 12px; line-height: 1.15; }
  #tear-head .tear-langs button { min-width: 34px; padding: 7px 2px; font-size: 12px; letter-spacing: .04em; }
  #tear-head .tear-out, #tear-head:has(.tear-out) .tear-actions .tear-act:has(.tear-label) { position: relative; overflow: hidden; justify-content: center; width: 44px; padding: 0; }
  #tear-head .tear-out .tear-label, #tear-head:has(.tear-out) .tear-actions .tear-label {
    position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
}

#tear-foot {
  box-sizing: border-box; margin: 56px 0 0; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px max(24px, env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  background: #16161a; color: rgba(255, 255, 255, .75); font: 400 12px/1.4 Menlo, ui-monospace, monospace; letter-spacing: .05em;
}
#tear-foot .tear-word { color: #fff; font: 600 15px/1 "Iowan Old Style", "New York", Georgia, serif; letter-spacing: .22em; }
#tear-foot { display: grid; grid-template-columns: 1fr auto 1fr; }
#tear-foot .tear-rights { text-align: right; white-space: nowrap; }
/* a tablet keeps one row: the sides take what they need, the links stay in the middle */
@media (min-width: 601px) and (max-width: 1100px) { #tear-foot { font-size: 11px; letter-spacing: .02em; column-gap: 12px; } }
#tear-foot .tear-legal { display: flex; gap: 10px; align-items: center; justify-content: center; }
#tear-foot .tear-legal a { color: rgba(255, 255, 255, .75); text-decoration: none; padding: 6px 0; }
#tear-foot .tear-legal a:hover, #tear-foot .tear-legal a:focus-visible { color: #fff; text-decoration: underline; }
@media (max-width: 600px) {
  #tear-foot { grid-template-columns: auto 1fr; row-gap: 6px; }
  #tear-foot .tear-rights { white-space: normal; }
  #tear-foot .tear-legal { grid-column: 1 / -1; grid-row: 2; }
}
@media print { #tear-foot .tear-legal { display: none; } }

@media print { #tear-head .tear-langs, #tear-head .tear-actions, #tear-head .tear-signout { display: none; } #tear-head { position: static; } }
