/* My Digital Drawer — styles for the Oct 2026 tool pages (loaded after site.css). */

.x-disclaimer {
  margin-top: 18px; padding: 12px 14px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 0.86rem; line-height: 1.5;
}
.x-disclaimer strong { color: var(--text); }

.x-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.x-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.x-grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 640px) {
  .x-grid3, .x-grid4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 420px) {
  .x-grid2 { grid-template-columns: 1fr; }
}
.x-field { margin-bottom: 14px; min-width: 0; }
.x-field label { display: block; font-weight: 700; font-size: 0.88rem; margin-bottom: 6px; }
.x-field small { display: block; color: var(--text-muted); font-size: 0.78rem; margin-top: 4px; }
input[type="time"], input[type="date"], input[type="datetime-local"], input[type="password"], input[type="email"], input[type="url"], input[type="search"] {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 0.95rem; font-family: inherit; background: var(--input-bg); color: var(--text);
}
.x-inline { display: flex; gap: 8px; align-items: center; }
.x-inline > * { min-width: 0; }
.x-inline select { width: auto; flex: 0 0 auto; }

/* Segmented control */
.x-seg { display: inline-flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; margin-bottom: 16px; background: var(--surface-2); }
.x-seg button { border: 0; background: transparent; color: var(--text); padding: 9px 14px; font-weight: 600; font-size: 0.88rem; cursor: pointer; font-family: inherit; }
.x-seg button + button { border-left: 1px solid var(--border); }
.x-seg button.active { background: var(--brand); color: #fff; }

/* Results */
.x-result { margin-top: 18px; padding: 18px; background: var(--success-bg); border: 1px solid var(--success-border); border-radius: var(--radius); }
.x-result[hidden] { display: none; }
.x-big { font-size: 1.9rem; font-weight: 800; color: var(--brand); line-height: 1.2; word-break: break-word; }
.x-big-label { font-size: 0.85rem; color: var(--text-muted); margin-top: 2px; }
.x-lines { margin: 12px 0 0; padding: 0; list-style: none; }
.x-lines li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--border); font-size: 0.93rem; }
.x-lines li:first-child { border-top: 0; }
.x-lines li span:last-child { font-weight: 700; text-align: right; }
.x-muted { color: var(--text-muted); font-size: 0.86rem; }
.x-ok { color: var(--accent); font-weight: 700; }
.x-bad { color: var(--danger); font-weight: 700; }

.x-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; margin-top: 10px; }
.x-table th, .x-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.x-table th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); }
.x-table-wrap { overflow-x: auto; }
.x-table input, .x-table select { padding: 7px 8px; font-size: 0.9rem; }

.x-mono, textarea.x-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.86rem; }
.x-out { white-space: pre-wrap; word-break: break-all; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 12px; min-height: 48px; }

.x-chip { display: inline-block; padding: 3px 9px; border-radius: 999px; background: var(--chip-bg); font-size: 0.78rem; font-weight: 600; color: var(--text-muted); }
.x-row-del { border: 0; background: transparent; color: var(--danger); font-size: 1.2rem; cursor: pointer; padding: 4px 8px; line-height: 1; }
.x-add { margin-top: 8px; }
.x-hide { display: none !important; }

/* Cards of big choices (sleep times, etc.) */
.x-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-top: 12px; }
.x-tile { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px; text-align: center; }
.x-tile .t { font-size: 1.25rem; font-weight: 800; color: var(--text); }
.x-tile .s { font-size: 0.76rem; color: var(--text-muted); margin-top: 2px; }
.x-tile.best { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }

/* Waveform / media */
.x-wave { width: 100%; height: 120px; display: block; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; touch-action: none; }
.x-media { width: 100%; max-height: 360px; border-radius: 10px; background: #000; display: block; }
audio.x-audio { width: 100%; margin-top: 10px; }
.x-progress { height: 8px; border-radius: 999px; background: var(--chip-bg); overflow: hidden; margin-top: 12px; }
.x-progress > div { height: 100%; width: 0; background: var(--brand); transition: width .15s; }
.x-filebar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; margin: 14px 0; font-size: 0.9rem; }
.x-filebar b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Big timer digits */
.x-timer { font-variant-numeric: tabular-nums; font-size: clamp(3rem, 14vw, 5.5rem); font-weight: 800; text-align: center; letter-spacing: .02em; color: var(--text); line-height: 1.1; margin: 8px 0; }

/* Tabs (simple) */
.x-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 18px; flex-wrap: wrap; }
.x-tabs button { border: 0; background: transparent; padding: 10px 14px; font-weight: 700; color: var(--text-muted); cursor: pointer; border-bottom: 3px solid transparent; font-family: inherit; font-size: 0.92rem; }
.x-tabs button.active { color: var(--brand); border-bottom-color: var(--brand); }

/* Homepage: category index chips */
.cat-index { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 28px; }
.cat-index a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--border); background: var(--surface); border-radius: 999px; font-weight: 600; font-size: 0.88rem; color: var(--text); }
.cat-index a:hover { border-color: var(--brand); text-decoration: none; }
.badge-new { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 0.66rem; font-weight: 800; vertical-align: middle; letter-spacing: .03em; }
