/* ID PLANNER widgets — shared look. Colours come from the 2027 digital planner PDFs. */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500&family=Roboto:wght@300;400;500&family=Noto+Sans+KR:wght@300;400;500&display=swap');

:root {
  --soft: #d9d5f5;      /* title-badge tone */
  --deep: #b3a2c2;      /* cover tone */
  --tint: #f2eff9;      /* lightest wash */
  --paper: #fcfcf9;
  --ink: #4a4a4a;
  --sub: #9a9a96;
  --line: #d9d9d4;
  --red: #e0605f;
  --blue: #6b7fd6;
  --bg: transparent;
  --radius: 18px;
  /* the knobs a style preset turns. A preset that only changed colour would not be a style,
     so density, corner, edge, shadow, badge shape and heading face all live here too. */
  --pad: 18px 20px;
  --shade: none;
  --edge: 1px solid var(--line);
  --badge-bg: var(--soft);
  --badge-fg: color-mix(in srgb, var(--deep) 55%, #2a2a2a);
  --badge-radius: 999px;
  --badge-pad: 5px 16px 4px;
  --badge-track: .22em;
  --badge-size: 11px;
  --badge-rule: none;
  --serif: 'Playfair Display', serif;
  --head: var(--serif);
}
:root[data-mode="dark"] {
  --paper: #202020;
  --ink: #e6e6e3;
  --sub: #8d8d88;
  --line: #3a3a38;
  --tint: color-mix(in srgb, var(--deep) 22%, #202020);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--bg); }
body {
  font-family: 'Roboto', 'Noto Sans KR', sans-serif;
  font-weight: 300;
  color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  padding: 6px;
  -webkit-font-smoothing: antialiased;
}
.card {
  /* body is a flex row; without this the card's automatic min-width is its min-content
     width, so a wide grid or a long footer pushes the whole card past a narrow screen
     instead of wrapping inside it. Measured on a 330px render of WORLD CLOCK. */
  width: 100%; height: 100%; min-width: 0;
  background: var(--paper);
  border: var(--edge);
  border-radius: var(--radius);
  padding: var(--pad);
  box-shadow: var(--shade);
  display: flex; flex-direction: column;
  overflow: hidden;
}
:root[data-frame="none"] .card { border: 0; background: transparent; padding: 8px; box-shadow: none; }
:root[data-frame="line"] .card { border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; }

/* the planner's oval title badge */
.badge {
  align-self: flex-start;
  background: var(--badge-bg);
  color: var(--badge-fg); /* white-on-pastel, as printed, is unreadable at widget size */
  border-radius: var(--badge-radius);
  padding: var(--badge-pad);
  font-size: var(--badge-size); font-weight: 500;
  letter-spacing: var(--badge-track); text-transform: uppercase;
  white-space: nowrap;
  border-bottom: var(--badge-rule);
}
.caps { font-size: 10px; letter-spacing: .24em; text-transform: uppercase; color: var(--sub); font-weight: 400; }
.serif { font-family: var(--serif); font-weight: 400; letter-spacing: .04em; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grow { flex: 1; min-height: 0; overflow: hidden; }
.center { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
button {
  font: inherit; color: var(--ink); cursor: pointer;
  background: var(--tint); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 16px;
  font-size: 10px; letter-spacing: .2em; text-transform: uppercase; font-weight: 400;
}
button:hover { background: var(--soft); }

/* ⚙ theme panel — hidden until the widget is hovered or tapped.
   (2026-10-03) bottom-LEFT: Notion puts its own 「⋯」 block menu on the embed's top-right corner and resize handles on the
   right edge · bottom centre · bottom-right, so a top-right ⚙ could not be clicked in Notion */
.idp-gear { position: fixed; bottom: 10px; left: 10px; width: 26px; height: 26px; padding: 0; border-radius: 50%;
  font-size: 13px; letter-spacing: 0; line-height: 24px; opacity: 0; transition: opacity .2s; z-index: 5; background: var(--paper); }
body:hover .idp-gear, .idp-gear:focus-visible, .idp-panel:not([hidden]) ~ .idp-gear { opacity: .85; }
@media (hover: none) { .idp-gear { opacity: .5; } }
.idp-panel { position: fixed; top: 42px; right: 10px; left: 10px; max-width: 260px; margin-left: auto; z-index: 6;
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 12px; box-shadow: 0 6px 24px rgba(0,0,0,.08);
  font-size: 11px; color: var(--ink); max-height: calc(100% - 52px); overflow: auto; }
.idp-panel[hidden] { display: none; }
.idp-panel-title { font-size: 9px; letter-spacing: .24em; color: var(--sub); margin-bottom: 8px; }
.idp-swatches { display: grid; grid-template-columns: repeat(10, 1fr); gap: 5px; margin-bottom: 10px; }
.idp-swatches button { aspect-ratio: 1; padding: 0; border-radius: 50%; border: 1px solid var(--line); }
.idp-row { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 11px; letter-spacing: 0; text-transform: none; }
.idp-row button { flex: 1; padding: 5px 0; font-size: 10px; letter-spacing: .05em; text-transform: none; }
.idp-row input[type=range] { flex: 1; }
.idp-row input[type=color] { width: 34px; height: 22px; border: 1px solid var(--line); border-radius: 6px; padding: 0; background: none; }
.idp-note { margin-top: 10px; font-size: 10px; color: var(--sub); }
button:focus-visible { outline: 2px solid var(--deep); outline-offset: 2px; }
.idp-link { width: 100%; margin-top: 8px; padding: 6px 8px; font: inherit; font-size: 9.5px; line-height: 1.5;
            letter-spacing: 0; color: var(--sub); background: var(--tint); border: 1px solid var(--line);
            border-radius: 8px; resize: none; word-break: break-all; }
.idp-link:focus { outline: none; color: var(--ink); }
.idp-warn { margin-top: 8px; color: color-mix(in srgb, var(--deep) 70%, #2a2a2a); line-height: 1.6; }
.idp-banner { position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 5;
              display: flex; align-items: baseline; gap: 8px; padding: 9px 11px; border-radius: 12px;
              background: var(--soft); color: var(--ink); font-size: 12px; line-height: 1.4;
              box-shadow: 0 6px 18px rgba(0,0,0,.08); animation: idp-rise .28s ease-out; }
.idp-banner .t { flex: 0 1 auto; }
.idp-banner .s, .idp-banner .q { flex: 1 1 auto; font-size: 10px; color: color-mix(in srgb, var(--deep) 65%, #2a2a2a); }
.idp-banner button { flex: none; padding: 0 4px; font-size: 13px; line-height: 1; background: none; border: 0; color: inherit; }
@keyframes idp-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.card { position: relative; }


/* ---- Style presets -------------------------------------------------------------------------
   Six ways the same card can feel. Each one moves density, corner, edge, shadow, badge and
   heading face together — a preset that only recoloured would just be the theme again.
   Colour still comes from the theme, so any preset works with any of the nine pastels. */

/* SOFT EDITORIAL — magazine. No box, wide margins, the title set as a line of type. */
:root[data-style="editorial"] {
  --pad: 26px 28px 22px;
  --radius: 2px;
  --edge: 0;
  --shade: none;
  --badge-bg: transparent;
  --badge-fg: color-mix(in srgb, var(--deep) 75%, #2a2a2a);
  --badge-radius: 0;
  --badge-pad: 0 0 7px;
  --badge-track: .34em;
  --badge-size: 10px;
  --badge-rule: 1px solid var(--soft);
}
:root[data-style="editorial"] .card { background: color-mix(in srgb, var(--tint) 45%, var(--paper)); }
/* frame=none 은 어떤 모양(editorial …)에서도 카드 바탕 · 그림자 없이 — R5 VISION 「흰 카드 반복 없이」(2026-10-06: editorial 바탕이 frame=none 을 덮던 것) */
:root[data-frame="none"][data-style] .card { background: transparent; box-shadow: none; }
:root[data-style="editorial"] .row { align-items: flex-end; }

/* MINIMAL PASTEL — the planner's own default, tightened. Hairline edge, soft corner. */
:root[data-style="minimal"] {
  --pad: 16px 18px;
  --radius: 20px;
  --edge: 1px solid var(--line);
  --shade: none;
  --badge-size: 10px;
  --badge-pad: 4px 13px 3px;
}

/* COZY CREAM — warm paper, round corner, one soft shadow. The most "object on a desk". */
:root[data-style="cream"] {
  --pad: 22px 24px;
  --radius: 26px;
  --edge: 0;
  --shade: 0 8px 26px color-mix(in srgb, var(--deep) 16%, transparent);
  --badge-pad: 6px 17px 5px;
  --badge-track: .18em;
}
:root[data-style="cream"]:not([data-mode="dark"]) { --paper: #fbf7f0; --line: #ece4d8; }
:root[data-style="cream"] .card { background: var(--paper); }

/* SAGE PLANNER — stationery. Square tag, printed-looking rule, compact rows. */
:root[data-style="sage"] {
  --pad: 15px 17px;
  --radius: 6px;
  --edge: 1px solid color-mix(in srgb, var(--deep) 32%, transparent);
  --shade: none;
  --badge-bg: color-mix(in srgb, var(--soft) 70%, var(--paper));
  --badge-radius: 3px;
  --badge-pad: 4px 9px 3px;
  --badge-track: .26em;
  --badge-size: 9.5px;
  --head: 'Roboto', 'Noto Sans KR', sans-serif;
}

/* LAVENDER NOTE — a tinted page from a notebook. No edge, ruled under the header. */
:root[data-style="note"] {
  --pad: 20px 22px;
  --radius: 14px;
  --edge: 0;
  --shade: none;
  --badge-bg: transparent;
  --badge-fg: color-mix(in srgb, var(--deep) 80%, #2a2a2a);
  --badge-radius: 0;
  --badge-pad: 0 2px 5px 0;
  --badge-track: .2em;
}
:root[data-style="note"] .card { background: color-mix(in srgb, var(--tint) 80%, var(--paper)); }
:root[data-style="note"] .row { border-bottom: 1px solid color-mix(in srgb, var(--deep) 22%, transparent);
                                padding-bottom: 8px; }

/* CLEAN BUSINESS — crisp and dense. Small square corner, accent bar instead of a pill. */
:root[data-style="business"] {
  --pad: 14px 16px;
  --radius: 4px;
  --edge: 1px solid var(--line);
  --shade: none;
  --badge-bg: transparent;
  --badge-fg: color-mix(in srgb, var(--deep) 78%, #2a2a2a);
  --badge-radius: 0;
  --badge-pad: 1px 0 1px 9px;
  --badge-track: .16em;
  --badge-size: 10px;
  --serif: 'Roboto', 'Noto Sans KR', sans-serif;
  --head: 'Roboto', 'Noto Sans KR', sans-serif;
}
:root[data-style="business"] .badge { border-left: 3px solid var(--deep); }
:root[data-style="business"] .caps { letter-spacing: .16em; }

.idp-styles { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.idp-styles button { padding: 6px 4px; font-size: 8px; letter-spacing: .08em; border-radius: 7px;
                     background: none; text-transform: none; white-space: nowrap; }
.idp-styles button.on { background: var(--tint); border-color: var(--soft); color: var(--ink); }

/* ⚙ list settings (playlist items …) — the panel takes the whole widget so names and links are easy to type */
.idp-panel.wide { max-width: none; left: 8px; right: 8px; top: 8px; max-height: calc(100% - 16px); padding: 14px; }
.idp-panel.wide ~ .idp-gear { z-index: 7; }
.idp-list { margin-top: 10px; }
.idp-list-head { font-size: 11.5px; color: var(--ink); margin-bottom: 6px; }
.idp-list-item { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px 10px; margin-top: 8px; background: var(--tint); }
.idp-list-top { display: flex; align-items: center; gap: 6px; font-size: 10px; color: var(--sub); }
.idp-list-top span { flex: 1; letter-spacing: .12em; }
.idp-list-top button { padding: 2px 8px; font-size: 10px; letter-spacing: 0; text-transform: none; }
.idp-list-field { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 7px; font-size: 10.5px; color: var(--sub); letter-spacing: 0; text-transform: none; }
.idp-list-field span { flex: 0 0 100%; }
.idp-list-field input { flex: 1; min-width: 0; font: inherit; font-size: 13px; color: var(--ink); padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.idp-list-field button { padding: 7px 10px; font-size: 11px; letter-spacing: 0; text-transform: none; }
.idp-photo .idp-photo-pick { flex: 1 1 100%; padding: 10px 12px; font-size: 12.5px; }   /* 사진 칸: 「사진 고르기」가 기본(2026-10-03) */
.idp-photo .idp-note { flex: 1 1 100%; margin-top: 2px; line-height: 1.5; }
.idp-photo-adv { flex: 1 1 100%; margin-top: 2px; }
.idp-photo-adv summary { cursor: pointer; font-size: 10.5px; color: var(--sub); list-style-position: inside; }
.idp-photo-adv input { width: 100%; margin-top: 6px; font: inherit; font-size: 13px; color: var(--ink); padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); box-sizing: border-box; }
.idp-list-add { width: 100%; margin-top: 8px; padding: 8px 0; font-size: 11.5px; letter-spacing: .04em; text-transform: none; }
.idp-panel.wide .idp-opts { padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.idp-panel.wide .idp-row input[type=text] { font: inherit; font-size: 13px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); }
/* 테마 3단계 — ⚙ 의 「모든 위젯 / 이 위젯만」 */
.idp-scope button.on { background: var(--soft); border-color: var(--soft); }
.idp-scope-note { margin: 6px 0 8px; line-height: 1.6; }
.idp-link-btn { background: none; border: 0; padding: 0; font-size: 10px; color: var(--ink); text-decoration: underline; cursor: pointer; }

/* R6 (2026-10-06) 아주 좁은 칸(HOME 양옆 · 1280px 화면에서 약 130~150px): 카드 안쪽 여백 · 이름표를 줄여 내용이 잘리지 않게 */
@media (max-width: 170px) { :root { --pad: 12px 9px; --badge-pad: 4px 9px 3px; --badge-track: .12em; --badge-size: 9.5px; } body { padding: 3px; } }
/* R6.1 고른 색 표시(GLOBAL THEME · THIS WIDGET) */
.idp-swatches button.on { outline: 2px solid var(--deep); outline-offset: 2px; }
