:root {
  color-scheme: dark;
  --page: #050505;
  --panel: #191919;
  --inset: #101011;
  --edge: #373739;
  --ink: #f7f7f7;
  --muted: #b5b5ba;
  --accent: #62e3d2;
  --rainbow: linear-gradient(90deg,#ff343c 0%,#ff8b18 20%,#ffd333 37%,#47ce61 53%,#12b9ae 68%,#536adb 81%,#a23ae4 91%,#ff64aa 100%);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--page);
  color: var(--ink);
  font: 16px/1.65 -apple-system,BlinkMacSystemFont,'Hiragino Sans','Yu Gothic',sans-serif;
}
.bar,main {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  padding-inline: max(18px,env(safe-area-inset-left)) max(18px,env(safe-area-inset-right));
}
.bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: max(20px,env(safe-area-inset-top)) 18px;
}
.bar::after {
  content: "";
  position: absolute;
  left: max(18px,env(safe-area-inset-left));
  right: max(18px,env(safe-area-inset-right));
  bottom: 0;
  height: 3px;
  border-radius: 20px;
  background: var(--rainbow);
}
.identity,.wordmark { display: flex; align-items: center; gap: 12px; }
.emblem { display: block; width: 44px; height: 44px; border-radius: 50%; }
.brand { color: #fff; font: italic 900 30px/1 Arial,'Helvetica Neue',sans-serif; letter-spacing: -.055em; }
.product { font-size: 13px; font-weight: 650; color: var(--muted); white-space: nowrap; }
#logout { margin-left: auto; font-size: 13px; }
main { padding-block: 22px calc(100px + env(safe-area-inset-bottom)); }
.auth-page .bar,.auth-page main { max-width: 496px; }
.auth-page .bar { justify-content: center; padding-top: max(50px,calc(env(safe-area-inset-top) + 32px)); padding-bottom: 0; }
.auth-page .bar::after { top: max(18px,env(safe-area-inset-top)); bottom: auto; height: 4px; }
.auth-page .identity,.auth-page .wordmark { flex-direction: column; }
.auth-page .identity { gap: 14px; }
.auth-page .wordmark { gap: 8px; }
.auth-page .emblem { width: 112px; height: 112px; }
.auth-page .brand { font-size: 40px; }
.auth-page .product,.kicker { display: flex; align-items: center; gap: 8px; }
.auth-page .product::before,.kicker::before { content: ""; width: 6px; height: 6px; background: var(--accent); border-radius: 50%; flex: none; }
.auth-page main { padding-top: 22px; }
.auth-page form button { width: 100%; margin-top: 10px; }
.auth-page .card > .ghost { margin-top: 12px; }
h1,h2,h3 { color: #fff; line-height: 1.35; overflow-wrap: anywhere; }
h1 { font-size: clamp(26px,5vw,38px); letter-spacing: -.045em; margin: 6px 0 18px; }
h2 { font-size: 20px; margin: 22px 0 12px; }
h3 { font-size: 16px; margin: 8px 0; }
p { margin: 8px 0 12px; }
.card,fieldset,.hero {
  min-width: 0;
  padding: clamp(16px,3vw,24px);
  margin: 0 0 14px;
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: 18px;
}
.card { background: linear-gradient(145deg,#1e1e1f,#181819); }
.card .card,fieldset fieldset { background: var(--inset); border-radius: 12px; }
.card :first-child:is(h1,h2,h3),.hero h1 { margin-top: 0; }
.card p,.lines { white-space: pre-wrap; overflow-wrap: anywhere; }
small,.muted,.kicker { color: var(--muted); font-size: 13px; }
.kicker { font-weight: 650; margin-bottom: 5px; }
.row,.tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tools { margin: 10px 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,145px),1fr)); gap: 10px; }
.hero { padding: 0; border: 0; background: transparent; margin-bottom: 24px; }
.hero .tools { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
.hero .tools > button {
  display: flex; justify-content: space-between; align-items: center; text-align: left;
  color: var(--ink); background: linear-gradient(135deg,#222223,#171718);
  border: 1px solid var(--edge); padding: 13px 16px; min-height: 54px; border-radius: 15px;
}
.hero .tools > button:first-child { grid-column: 1/-1; min-height: 62px; font-size: 17px; }
.hero .tools > button::after {
  content: "›"; display: grid; place-items: center; flex: none;
  width: 26px; height: 26px; border: 1px solid #555559; border-radius: 50%;
  color: #ddd; font: 18px/1 Arial,sans-serif; margin-left: 6px;
}
.hero .tools > button:first-child::after { color: var(--accent); border-color: #436a64; }
button,input,select,textarea { font: inherit; }
button {
  min-height: 44px; max-width: 100%; padding: 9px 16px;
  background: #f2f2f2; color: #131313; border: 1px solid transparent; border-radius: 12px;
  font-weight: 700; line-height: 1.45; cursor: pointer;
}
button.alt,button.ghost { background: #242425; color: var(--ink); border-color: #424245; }
button.ghost { background: transparent; padding-inline: 12px; }
button.danger { color: #ffb2b9; background: #31191e; border-color: #633039; }
button:disabled { opacity: .55; cursor: default; }
button:enabled:active { filter: brightness(.86); }
label.field { display: block; min-width: 0; font-weight: 650; font-size: 14px; margin: 7px 0 12px; }
input:not([type=checkbox]),select,textarea {
  display: block; min-width: 0; width: 100%; margin-top: 5px; padding: 10px 12px;
  border: 1px solid #626265; border-radius: 10px; background: var(--inset); color: var(--ink);
  font-size: 16px; font-weight: 400; min-height: 46px; line-height: 1.5;
}
textarea { min-height: 82px; resize: vertical; }
::placeholder { color: #a2a2a8; opacity: 1; }
option { background: var(--inset); color: var(--ink); }
input[type=checkbox] { width: 19px; height: 19px; margin: 0 5px 0 0; vertical-align: middle; accent-color: var(--accent); }
.check { display: flex; align-items: center; min-height: 44px; font-size: 14px; cursor: pointer; }
.fieldRow { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 50px; border-bottom: 1px solid var(--edge); }
.fieldRow:last-child { border-bottom: 0; }
.fieldRow span { overflow-wrap: anywhere; }
.fieldRow .check { flex-shrink: 0; color: #ddd; }
.entryHead { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; border-bottom: 1px solid var(--edge); padding-bottom: 9px; margin-bottom: 12px; }
.entryHead b,.marks { font-variant-numeric: tabular-nums; font-weight: 700; }
.entryHead b { font-size: 18px; }
.tag { border: 1px solid #464648; border-radius: 20px; padding: 2px 9px; font-size: 12px; color: #ddd; }
legend,summary { font-weight: 700; }
legend { padding: 0 6px; }
details { margin: 12px 0; }
summary { cursor: pointer; min-height: 44px; padding-block: 8px; }
.attempt { border-top: 1px dashed #555; margin-top: 10px; padding-top: 10px; }
nav {
  position: fixed; z-index: 4; bottom: max(8px,env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  display: flex; gap: 4px; width: min(calc(100% - 28px),550px); padding: 5px;
  background: #19191b; border: 1px solid #424245; border-radius: 20px; box-shadow: 0 4px 22px #0009;
}
nav button { flex: 1; padding: 6px 3px; background: transparent; color: var(--muted); font-size: 14px; border-radius: 14px; }
nav .selected { background: #343436; color: #fff; }
#notice,.saveStatus { position: sticky; top: 0; font-size: 14px; }
#notice { background: #34281a; color: #ffe0ab; padding: 10px 16px; text-align: center; z-index: 3; }
.saveStatus {
  display: flex; align-items: center; gap: 10px; min-height: 40px;
  padding: 6px 12px; margin-bottom: 12px; color: #dedee2; background: #222224;
  border: 1px solid #444446; border-radius: 10px; z-index: 2;
}
.saveStatus::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #a5a5ac; flex: none; }
.saveStatus[data-state=saved]::before { background: var(--accent); }
.saveStatus[data-state=pending]::before { background: #ffbd66; }
.saveStatus[data-state=error]::before { background: #ff8293; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
@media (max-width: 540px) {
  .grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .hero .tools { grid-template-columns: minmax(0,1fr); }
  .hero .tools > button { min-height: 52px; }
  .wordmark { gap: 7px; }
  .identity { gap: 8px; }
}
@media (max-width: 360px) {
  .grid { grid-template-columns: minmax(0,1fr); }
  .bar { gap: 6px; }
  .bar .emblem { width: 36px; height: 36px; }
  .auth-page .emblem { width: 96px; height: 96px; }
}

/* The frame provides the border independently of WebKit's intrinsic picker width. */
.pickerFrame { box-sizing:border-box; display:block; width:100%; max-width:100%; min-width:0; margin-top:5px; overflow:hidden; border:1px solid #626265; border-radius:10px; background:var(--inset); }
label.field .pickerFrame input { display:block; -webkit-appearance:none; appearance:none; box-sizing:border-box; width:100%; max-width:100%; min-width:0; margin:0; border:0; border-radius:0; text-align:left; background:transparent; }
.pickerFrame input::-webkit-date-and-time-value { text-align:left; min-width:0; }
.pickerFrame:focus-within { outline:3px solid var(--accent); outline-offset:2px; }
.pickerFrame input:focus { outline:none; }
.fieldSettingsRow { padding-block:8px; border-bottom:1px solid var(--edge); }
.fieldSettingsRow:last-child,.fieldSettingsRow .fieldRow { border:0; }
[data-policy="always"] { --policy-color:#63d8b7; }
[data-policy="never"] { --policy-color:#acb7dc; }
[data-policy="ask"] { --policy-color:#f2c578; }
.privacyCard,.policySetting { border-inline-start:4px solid var(--policy-color); }
.policySetting { padding-inline-start:10px; }
.policyState { display:block; color:var(--policy-color); font-weight:700; }
.privacyCard>.check { min-height:40px; }

.dashboard { max-width: 610px; margin: 0 auto; padding-block: 12px; }
.dashboard h1 { font-size: clamp(32px,7vw,46px); line-height: 1.2; letter-spacing: -.04em; margin: 6px 0; }
.dashboard p { color: var(--muted); margin: 0 0 14px; }
.dashboard .dayline { font-size: 14px; letter-spacing: .04em; margin-bottom: 4px; }
.recordToday { width: 100%; display: grid; justify-items: center; gap: 4px; padding: 20px; border-radius: 17px; font-size: 21px; }
.homeTiles { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-block: 15px; }
.homeTile { display: grid; justify-items: start; text-align: left; align-content: start; gap: 7px; min-height: 115px; padding: 16px; border: 1px solid var(--edge); border-radius: 16px; background: var(--panel); color: var(--ink); }
.homeTile strong { font-size: 18px; }
.homeTile small { color: var(--muted); font-weight: 450; }
.homeTile:disabled { opacity: .65; }
nav button { display: grid; gap: 3px; justify-items: center; align-content: center; font-size: 12px; }
nav button svg { width: 19px; height: 19px; }
.thread { border-top: 1px solid var(--edge); padding-block: 12px; }
.thread p { margin: 3px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.threadReply { margin: 9px 0 0 12px; padding-left: 12px; border-left: 2px solid var(--edge); }

#settingsShortcut { display: none; margin-left: auto; font-size: 22px; }
.dashboardPage #settingsShortcut { display: block; }
.dashboardPage #logout { display: none; }
