/* ================================================================
   miniPad - Warm Paper Studio
   Cream tones, terracotta accents, soft shadows, rounded forms
   ================================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #faf6f1;
  --bg-surface: #fffefb;
  --bg-elevated: #f8f2ea;
  --bg-warm: #f3ece3;
  --border: #e5dbce;
  --border-soft: #ede4d8;
  --shadow-sm: 0 1px 3px rgba(80, 50, 30, 0.06);
  --shadow-md: 0 3px 12px rgba(80, 50, 30, 0.08);
  --shadow-lg: 0 8px 30px rgba(80, 50, 30, 0.10);
  --accent: #e0753a;
  --accent-light: #f0a070;
  --accent-soft: rgba(224, 117, 58, 0.12);
  --sage: #5b8c5a;
  --sage-soft: rgba(91, 140, 90, 0.12);
  --text: #3d3226;
  --text-secondary: #6b5e50;
  --text-dim: #b8a898;
  --text-ultradim: #d4c8ba;
  --success: #6b9b6b;
  --warning: #d4952a;
  --danger: #c4553d;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Times New Roman", serif;
  --header-h: 52px;
  --transition-speed: 0.38s;
}

html {
  height: 100%;
  min-height: 100vh;
  overflow: hidden;
  font-family: var(--font-sans);
  background: #fffefb;
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

body {
  position: relative;
  height: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  font-family: var(--font-sans);
  background: #fffefb;
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

/* === PAGE CONTAINER === */
#page-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  background: #fffefb;
}

/* === PAGES === */
.page {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform var(--transition-speed) cubic-bezier(0.32, 0.72, 0, 1), opacity 0.3s ease-out;
  will-change: transform;
}

.page.active {
  transform: translateX(0);
  z-index: 1;
}

.page.prev {
  transform: translateX(-100%);
  opacity: 0.4;
}

.page.next {
  transform: translateX(100%);
  opacity: 0.4;
}

.page.hidden {
  transform: translateX(0);
  opacity: 0;
  pointer-events: none;
}

.page-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px;
  overflow-y: auto;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  flex-shrink: 0;
}

.page-header h1 {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.5px;
}

.page-title-lg {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

/* === PAGE INDICATOR === */
/* === SCROLL AREA === */
.scroll-area {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 16px;
}

/* === FILTER BAR === */
.filter-bar {
  display: flex;
  padding: 8px 16px 12px;
  flex-shrink: 0;
}

.filter-bar button {
  padding: 8px 18px;
  margin-right: 8px;
  border: none;
  border-radius: 20px;
  background: var(--bg-warm);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--font-sans);
  transition: all 0.25s;
  box-shadow: var(--shadow-sm);
}

.filter-bar button.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(224, 117, 58, 0.3);
}

/* === TODO LIST === */
.todo-item {
  display: flex;
  align-items: center;
  padding: 14px 14px;
  margin-bottom: 4px;
  border-radius: 14px;
  background: var(--bg-surface);
  min-height: 54px;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.todo-item:active {
  background: var(--bg-elevated);
  transform: scale(0.985);
}

.todo-item.completed {
  opacity: 0.5;
}

.todo-item.completed .todo-text {
  text-decoration: line-through;
  color: var(--text-dim);
}

.todo-check {
  width: 30px;
  height: 30px;
  min-width: 30px;
  border: 2px solid var(--border);
  border-radius: 10px;
  margin-right: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.25s;
  color: transparent;
  background: var(--bg-warm);
}

.todo-check.done {
  background: var(--sage);
  border-color: var(--sage);
  color: #fff;
  box-shadow: 0 2px 8px rgba(91, 140, 90, 0.3);
}

.priority-dot {
  width: 9px;
  height: 9px;
  min-width: 9px;
  border-radius: 50%;
  margin-right: 12px;
}

.priority-dot.high { background: var(--danger); }
.priority-dot.medium { background: var(--warning); }
.priority-dot.low { background: var(--sage); }

.todo-text {
  flex: 1;
  font-size: 16px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.todo-due {
  font-size: 12px;
  color: var(--text-dim);
  margin-left: 10px;
  white-space: nowrap;
  font-weight: 500;
  background: var(--bg-warm);
  padding: 4px 10px;
  border-radius: 8px;
}

.todo-actions {
  display: flex;
  margin-left: 4px;
}

.todo-actions button {
  width: 34px;
  height: 34px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 16px;
  cursor: pointer;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  transition: all 0.2s;
}

.todo-actions button:active {
  background: var(--bg-warm);
  color: var(--accent);
}

/* === BUTTONS === */
.btn-add {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 22px;
  font-weight: 400;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  box-shadow: 0 3px 12px rgba(224, 117, 58, 0.3);
  transition: all 0.2s;
}

.btn-add:active {
  transform: scale(0.93);
  box-shadow: 0 1px 4px rgba(224, 117, 58, 0.3);
}

.btn-primary {
  padding: 12px 24px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-sans);
  box-shadow: 0 3px 12px rgba(224, 117, 58, 0.25);
  transition: all 0.2s;
}

.btn-primary:active {
  transform: scale(0.95);
}

.btn-round {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  box-shadow: 0 6px 24px rgba(224, 117, 58, 0.3);
  transition: all 0.25s;
}

.btn-round:active {
  transform: scale(0.92);
  box-shadow: 0 3px 12px rgba(224, 117, 58, 0.3);
}

.btn-round-lg {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  box-shadow: 0 6px 24px rgba(224, 117, 58, 0.3);
  transition: all 0.25s;
}

.btn-round-lg:active {
  transform: scale(0.92);
}

.btn-text {
  padding: 10px 20px;
  background: var(--bg-warm);
  color: var(--text-secondary);
  border: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-sans);
  border-radius: 12px;
  transition: all 0.2s;
}

.btn-text:active {
  background: var(--accent-soft);
  color: var(--accent);
}

/* === INLINE FORM === */
.inline-form {
  padding: 20px;
  margin: 12px;
  border-radius: 18px;
  flex-shrink: 0;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-md);
}

.inline-form input,
.inline-form select {
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 10px;
  background: var(--bg-surface);
  border: 2px solid var(--border-soft);
  border-radius: 14px;
  color: var(--text);
  font-size: 15px;
  font-family: var(--font-sans);
  transition: border-color 0.2s;
}

.inline-form input:focus,
.inline-form select:focus {
  outline: none;
  border-color: var(--accent-light);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-row {
  display: flex;
  margin-bottom: 10px;
}

.form-row > * {
  flex: 1;
  margin-right: 8px;
}

.form-row > *:last-child {
  margin-right: 0;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
}

.form-actions button {
  margin-left: 10px;
}

/* === CALENDAR === */
#calendar-nav {
  display: flex;
  align-items: center;
}

#calendar-nav > * {
  margin-right: 16px;
}

#calendar-nav > *:last-child {
  margin-right: 0;
}

#calendar-nav button {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 10px;
  background: var(--bg-warm);
  color: var(--text-secondary);
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  transition: all 0.2s;
}

#calendar-nav button:active {
  background: var(--accent-soft);
  color: var(--accent);
}

#cal-month-label {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

#calendar-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 3px;
  table-layout: fixed;
  flex-shrink: 0;
  padding: 0 10px;
}

#calendar-table th {
  text-align: center;
  padding: 10px 0 6px;
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 500;
}

#calendar-table td {
  text-align: center;
  padding: 0;
  cursor: pointer;
}

.cal-cell-inner {
  width: 100%;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 500;
  position: relative;
  min-width: 40px;
  min-height: 40px;
  border-radius: 12px;
  transition: all 0.15s;
}

.cal-cell-inner:active {
  background: var(--accent-soft);
}

.cal-cell-inner.today {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 3px 10px rgba(224, 117, 58, 0.3);
}

.cal-cell-inner.has-todo::after {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--sage);
  position: absolute;
  bottom: 7px;
  box-shadow: 0 1px 3px rgba(91, 140, 90, 0.3);
}

.cal-cell-inner.other-month {
  color: var(--text-ultradim);
}

.cal-cell-inner.selected {
  background: var(--sage-soft);
  color: var(--sage);
  font-weight: 600;
}

.cal-todos {
  border-top: 1px solid var(--border-soft);
  margin-top: 12px;
}

.cal-todos .todo-item {
  font-size: 14px;
  min-height: 46px;
}

/* === FOCUS PAGE (Weather bg + Pomodoro float + Noise bar) === */

/* Weather video background */
.wx-video {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  opacity: 0;
  transition: opacity 1s ease;
  pointer-events: none;
}
.wx-video.show { opacity: 1; }

/* Weather effects canvas layer (desktop) */
.wx-effects {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  pointer-events: none;
  z-index: 1;
  width: 100%;
  height: 100%;
}

/* Lock indicator */

/* Weather-driven backgrounds */
.focus-bg {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: linear-gradient(160deg, #fef9e7 0%, #faf6f1 40%, #f3ece3 100%);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: background 1.2s ease;
}

.focus-bg.wx-sunny  { background: linear-gradient(160deg, #fef9e7 0%, #fdebd0 40%, #faf1e4 100%); }
.focus-bg.wx-cloudy { background: linear-gradient(160deg, #f2f4f7 0%, #e8ecf2 40%, #f0ece6 100%); }
.focus-bg.wx-rain  { background: linear-gradient(160deg, #e9eef3 0%, #d5dde6 40%, #e9e4dc 100%); }
.focus-bg.wx-snow  { background: linear-gradient(160deg, #f5f7fa 0%, #e4eaf2 40%, #f2efe9 100%); }
.focus-bg.wx-fog   { background: linear-gradient(160deg, #f0f0f4 0%, #e4e4ea 40%, #ede9e2 100%); }
.focus-bg.wx-storm { background: linear-gradient(160deg, #e0dfe8 0%, #cdccd8 40%, #ddd8cf 100%); }
.focus-bg.wx-night { background: linear-gradient(160deg, #e6e5f0 0%, #d5d4e2 40%, #e2ded6 100%); }

/* Weather info: top-left */
.focus-weather-info {
  position: absolute;
  top: 24px;
  left: 28px;
  display: flex;
  align-items: flex-start;
  z-index: 2;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.fw-icon {
  font-size: 72px;
  line-height: 1;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.06));
}

.fw-text {
  margin-left: 12px;
  padding-top: 4px;
}

.fw-temp {
  font-family: var(--font-serif);
  font-size: 64px;
  font-weight: 600;
  line-height: 1;
  color: var(--text);
  letter-spacing: -2px;
}

.fw-desc {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-top: 2px;
}

.fw-detail {
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 500;
  margin-top: 1px;
}

.fw-time {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 6px;
}


/* Pomodoro: top-right, no border, click ring to start */
.focus-pomo-float {
  position: absolute;
  top: 20px;
  right: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
}

.fp-ring-wrap {
  position: relative;
  width: 200px;
  height: 200px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.2s;
}

.fp-ring-wrap:active {
  transform: scale(0.96);
}

.fp-ring-wrap.running {
  animation: fp-pulse 2s ease-in-out infinite;
}

@keyframes fp-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

#pomodoro-svg {
  width: 100%;
  height: 100%;
}

.fp-time {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-serif);
  font-size: 48px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 3px;
}

.fp-time.break-mode {
  color: var(--sage);
}

.fp-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 6px;
  letter-spacing: 0.5px;
}

.fp-bottom {
  display: flex;
  align-items: center;
  margin-top: 4px;
}

.fp-count {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 500;
  margin-right: 12px;
}

.fp-reset {
  padding: 4px 10px;
  border: none;
  border-radius: 8px;
  background: rgba(255,255,255,0.4);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all 0.2s;
}

.fp-reset:active {
  background: var(--accent-soft);
  color: var(--accent);
}

/* Flip clock */
.flip-clock {
  position: absolute;
  top: 170px;
  left: 28px;
  z-index: 5;
}
.flip-date-text {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  text-shadow: 0 1px 4px rgba(0,0,0,0.15);
  margin-bottom: 10px;
  padding-left: 2px;
}
.flip-time-row {
  display: flex;
  align-items: center;
}
.flip-digit {
  width: 50px;
  height: 70px;
  margin: 0 3px;
  position: relative;
  perspective: 400px;
}
.flip-digit-inner {
  width: 100%;
  height: 100%;
  position: relative;
}
.flip-digit-top {
  width: 100%;
  height: 50%;
  line-height: 70px;
  font-family: "Helvetica Neue", "PingFang SC", sans-serif;
  font-size: 48px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  background: rgba(255, 252, 248, 0.92);
  border-radius: 8px 8px 0 0;
  overflow: hidden;
  border-bottom: 1px solid rgba(180, 150, 120, 0.18);
  -webkit-transform: translateZ(0);
}
.flip-digit-bottom-wrap {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 50%;
  -webkit-transform-origin: top center;
  transform-origin: top center;
  -webkit-transform-style: preserve-3d;
  transform-style: preserve-3d;
}
.flip-digit-bottom {
  width: 100%;
  height: 100%;
  line-height: 0;
  font-family: "Helvetica Neue", "PingFang SC", sans-serif;
  font-size: 48px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  background: rgba(255, 252, 248, 0.92);
  border-radius: 0 0 8px 8px;
  overflow: hidden;
  position: absolute;
  top: 0;
  left: 0;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-transform: translateZ(0);
}
.flip-digit-bottom.back {
  -webkit-transform: rotateX(180deg) translateZ(1px);
  transform: rotateX(180deg) translateZ(1px);
}
.flip-digit-bottom-wrap.flipping {
  -webkit-animation: flip-down 0.35s cubic-bezier(0.4, 0, 0.6, 1) forwards;
  animation: flip-down 0.35s cubic-bezier(0.4, 0, 0.6, 1) forwards;
}
@-webkit-keyframes flip-down {
  0%   { -webkit-transform: rotateX(0deg); }
  100% { -webkit-transform: rotateX(-180deg); }
}
@keyframes flip-down {
  0%   { transform: rotateX(0deg); }
  100% { transform: rotateX(-180deg); }
}
.flip-colon {
  font-family: "Helvetica Neue", "PingFang SC", sans-serif;
  font-size: 42px;
  font-weight: 700;
  color: rgba(255,255,255,0.55);
  margin: 0 4px;
  line-height: 70px;
  animation: colon-blink 1s step-end infinite;
  text-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
@keyframes colon-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

/* White noise: floating buttons on top of video */
.focus-noise-bar {
  position: absolute;
  bottom: 16px;
  left: 0;
  right: 0;
  padding: 0 16px;
  z-index: 5;
  pointer-events: none;
}

.fn-bar-presets {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  pointer-events: auto;
}

.fn-bar-presets button {
  padding: 9px 20px;
  margin: 4px 6px;
  border: none;
  border-radius: 22px;
  background: rgba(0, 0, 0, 0.18);
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all 0.25s;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.fn-bar-presets button:active {
  transform: scale(0.95);
}

.fn-bar-presets button.active-preset {
  background: rgba(255, 255, 255, 0.35);
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.2);
  box-shadow: 0 0 16px rgba(255,255,255,0.2);
  animation: fn-glow 2s ease-in-out infinite;
}

@keyframes fn-glow {
  0%, 100% { box-shadow: 0 0 16px rgba(255,255,255,0.2); }
  50% { box-shadow: 0 0 28px rgba(255,255,255,0.4); }
}

/* === PHOTO FRAME === */
#photo-frame-container {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: #1a1a18;
  display: flex;
  align-items: center;
  justify-content: center;
}

#page-photo {
  position: absolute;
}

.photo-placeholder-full {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 15px;
  font-weight: 500;
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 1;
}

.photo-placeholder-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.6;
}

.photo-img-full {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 1.5s ease-in-out;
}

.photo-toolbar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: linear-gradient(transparent, rgba(26, 26, 24, 0.85));
  z-index: 5;
}

.photo-toolbar > * {
  margin-right: 8px;
}

.photo-toolbar > *:last-child {
  margin-right: 0;
}

.photo-toolbar .btn-text {
  color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.1);
}

#photo-counter {
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
  font-weight: 500;
  min-width: 60px;
  text-align: center;
}

.upload-label { cursor: pointer; }

.upload-btn-big {
  padding: 14px 28px;
  display: inline-block;
  cursor: pointer;
}

/* === ORIENTATION: PORTRAIT ADAPTATION === */

@media (orientation: portrait) {
  /* -- Page header: tighter padding -- */
  .page-header {
    padding: 12px 14px 10px;
  }
  .page-header h1 {
    font-size: 18px;
  }

  /* -- Scroll area: less horizontal padding -- */
  .scroll-area {
    padding: 0 10px;
  }

  /* -- Filter bar: compact -- */
  .filter-bar {
    padding: 6px 10px 10px;
    flex-wrap: wrap;
  }
  .filter-bar button {
    padding: 6px 14px;
    margin-bottom: 4px;
    font-size: 12px;
  }

  /* -- TODO page: form fields stack -- */
  #todo-form .form-row {
    flex-direction: column;
  }
  #todo-form .form-row > * {
    width: 100%;
    margin-right: 0;
    margin-bottom: 8px;
  }

  /* -- Calendar: compact table -- */
  #calendar-table {
    font-size: 12px;
  }
  #calendar-table th,
  #calendar-table td {
    padding: 4px 2px;
    min-width: 0;
  }
  #calendar-nav {
    gap: 6px;
  }
  #calendar-nav button {
    padding: 4px 10px;
  }
  #cal-month-label {
    font-size: 15px;
  }

  /* -- Focus page: stack vertically -- */
  .focus-pomo-float {
    top: 60px;
    right: 10px;
    transform: scale(0.7);
    transform-origin: top right;
  }
  .focus-weather-info {
    top: 10px;
    left: 10px;
    font-size: 13px;
  }
  .flip-clock {
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) scale(0.8);
  }
  .focus-noise-bar {
    bottom: 20px;
    left: 10px;
    right: 10px;
  }

  /* -- Photo frame: portrait images fill -- */
  #photo-frame-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .photo-img-full {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
  }

  /* -- Nav bar: keep at bottom, compact -- */
  .nav-bar {
    padding: 6px 0;
  }
  .nav-item {
    font-size: 11px;
  }
  .nav-item .nav-icon {
    font-size: 18px;
  }
}

/* === MONITOR DASH === */
.monitor-dash {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 10px 16px 14px;
  min-height: 0;
}

.md-row {
  display: flex;
  flex: 1;
  min-height: 0;
  margin-bottom: 8px;
}

.md-row:last-child {
  margin-bottom: 0;
}

.md-row-3 > .md-card {
  flex: 1;
  margin-right: 10px;
}

.md-row-3 > .md-card:last-child {
  margin-right: 0;
}

.md-row-2 > .md-card {
  flex: 1;
  margin-right: 10px;
}

.md-row-2 > .md-card:last-child {
  margin-right: 0;
}

.md-card {
  background: var(--bg-elevated);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.md-card-label {
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.md-card-sub {
  text-align: center;
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 500;
  flex-shrink: 0;
}

/* Gauge */
.md-gauge-wrap {
  position: relative;
  width: 90px;
  height: 90px;
  margin: 0 auto;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.md-gauge-svg {
  width: 100%;
  height: 100%;
}

.md-gauge-num {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 600;
  color: var(--text);
}

.md-gauge-pct {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--text-dim);
  font-weight: 500;
}

/* System info */
.md-sys-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.md-sys-line {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 12px;
}

.md-sys-line span:first-child {
  color: var(--text-dim);
  font-weight: 500;
}

.md-sys-line span:last-child {
  font-weight: 600;
  color: var(--text);
}

/* Disk */
.md-card-disk {
  overflow-y: auto;
}

/* Network */
.md-net-inner {
  flex: 1;
}

.md-net-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
}

.md-net-dir {
  font-size: 13px;
  font-weight: 500;
}

.md-net-dir.up { color: var(--accent); }
.md-net-dir.down { color: var(--sage); }

.md-net-line span:last-child {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

/* Process list (inside monitor card) */
.md-proc-inner {
  flex: 1;
  overflow-y: auto;
}

/* Keep JS-generated class styles */
.monitor-host-tag {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 500;
  background: var(--bg-warm);
  padding: 6px 14px;
  border-radius: 10px;
}

.monitor-disk-item {
  display: flex;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--border-soft);
}

.monitor-disk-item:last-child { border-bottom: none; }

.monitor-disk-mount {
  width: 36px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  font-family: var(--font-serif);
}

.monitor-disk-bar-wrap {
  flex: 1;
  margin: 0 10px;
}

.monitor-disk-bar-bg {
  width: 100%;
  height: 8px;
  background: var(--bg-warm);
  border-radius: 4px;
  overflow: hidden;
}

.monitor-disk-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s ease;
  background: var(--sage);
}

.monitor-disk-bar-fill.warn { background: var(--warning); }
.monitor-disk-bar-fill.danger { background: var(--danger); }

.monitor-disk-info {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 500;
  text-align: right;
  min-width: 80px;
  white-space: nowrap;
}

.monitor-proc-item {
  display: flex;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid var(--border-soft);
}

.monitor-proc-item:last-child { border-bottom: none; }

.monitor-proc-name {
  flex: 1;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.monitor-proc-pid {
  font-size: 10px;
  color: var(--text-dim);
  margin-right: 10px;
}

.monitor-proc-cpu {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  min-width: 44px;
  text-align: right;
}

.monitor-proc-bar-wrap {
  width: 60px;
  margin-left: 6px;
}

.monitor-proc-bar-bg {
  width: 100%;
  height: 4px;
  background: var(--bg-warm);
  border-radius: 2px;
  overflow: hidden;
}

.monitor-proc-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--accent-light);
  transition: width 0.8s ease;
}

.monitor-error {
  text-align: center;
  padding: 20px 0;
  color: var(--text-dim);
  font-size: 14px;
}

/* === FLASH OVERLAY === */
#flash-overlay {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(224, 117, 58, 0.1);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 72px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}

#flash-overlay.show {
  opacity: 1;
}

/* === LANDSCAPE FINE-TUNING === */
@media (max-height: 800px) {
  .pomodoro-ring-container {
    width: 140px;
    height: 140px;
  }
  .pomodoro-time-md {
    font-size: 34px;
  }
  .weather-icon-sm {
    font-size: 40px;
  }
  .weather-temp-sm {
    font-size: 40px;
  }
  .tools-panel {
    padding: 12px 8px;
  }
}
