/* =========================================================
   AIヘルプデスク — Aeon Demo pink design system
   ========================================================= */
:root {
  --pink-700: #c2006b;
  --pink-600: #e4007f;
  --pink-500: #f0308f;
  --pink-400: #ff6fae;
  --pink-200: #ffc7e1;
  --pink-100: #ffe6f1;
  --pink-50: #fff5fa;
  --plum-900: #2b0f22;
  --plum-700: #5b3550;
  --muted: #8c7484;
  --faint: #b9a5b1;
  --bg: #fbf7f9;
  --surface: #ffffff;
  --line: #f1e3eb;
  --line-strong: #e6d0dc;
  --grad: linear-gradient(135deg, #e4007f 0%, #ff4f9c 100%);
  --grad-soft: linear-gradient(135deg, #fff0f7 0%, #ffe3f0 100%);

  --st-proc: #7c5cff;
  --st-ai: #12a594;
  --st-wait: #e4007f;
  --st-prog: #e89a00;
  --st-done: #9b8b95;
  --danger: #d92d4a;
  --ok: #12a594;

  --r-sm: 10px;
  --r: 16px;
  --r-lg: 22px;
  --sh-1: 0 1px 2px rgba(91, 18, 60, 0.05), 0 2px 8px rgba(91, 18, 60, 0.04);
  --sh-2: 0 2px 6px rgba(91, 18, 60, 0.06), 0 12px 32px rgba(91, 18, 60, 0.08);
  --sh-pink: 0 8px 22px rgba(228, 0, 127, 0.28);
  --font: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
  --font-num: "Outfit", "Zen Kaku Gothic New", sans-serif;
  font-family: var(--font);
  color: var(--plum-900);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-size: 14px; line-height: 1.65; letter-spacing: 0.01em;
  background:
    radial-gradient(900px 500px at 105% -10%, rgba(255, 111, 174, 0.16), transparent 60%),
    radial-gradient(700px 420px at -10% 110%, rgba(228, 0, 127, 0.07), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--pink-600); }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
.hidden { display: none !important; }
.num { font-family: var(--font-num); font-feature-settings: "tnum"; }
::selection { background: var(--pink-200); }

/* ---------- Shell ---------- */
.app { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; padding: 18px 14px; display: flex; flex-direction: column; gap: 18px; }
.side-inner { background: rgba(255, 255, 255, 0.82); backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); flex: 1; display: flex; flex-direction: column; padding: 18px 12px 12px; min-height: 0; }
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 18px; }
.logo { width: 40px; height: 40px; flex: none; }
.brand-name { font-family: var(--font-num); font-weight: 700; font-size: 17px; letter-spacing: 0.02em; line-height: 1.1; }
.brand-name b { color: var(--pink-600); }
.brand-sub { font-size: 10px; color: var(--muted); margin-top: 3px; white-space: nowrap; }
.nav-label { font-family: var(--font-num); font-size: 10.5px; letter-spacing: 0.14em; color: var(--faint); padding: 10px 12px 6px; text-transform: uppercase; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 12px; color: var(--plum-700); text-decoration: none; font-weight: 500; transition: background .15s, color .15s; }
.nav a .ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--pink-50); color: var(--pink-600); flex: none; transition: all .15s; }
.nav a svg { width: 18px; height: 18px; }
.nav a:hover { background: var(--pink-50); color: var(--plum-900); }
.nav a > span:not(.ico):not(.badge) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; font-size: 13.5px; }
.nav a.active { background: var(--grad); color: #fff; box-shadow: var(--sh-pink); }
.nav a.active .ico { background: rgba(255, 255, 255, 0.2); color: #fff; }
.nav .badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--pink-600); color: #fff; font: 600 12px/22px var(--font-num); text-align: center; }
.nav a.active .badge { background: #fff; color: var(--pink-600); }
.side-spacer { flex: 1; }
.me { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; background: var(--grad-soft); }
.me .who { font-weight: 700; font-size: 13px; line-height: 1.3; }
.me .role { font-size: 11px; color: var(--muted); }
.icon-btn { width: 32px; height: 32px; border-radius: 10px; border: 0; background: #fff; color: var(--plum-700); display: grid; place-items: center; cursor: pointer; box-shadow: var(--sh-1); flex: none; }
.icon-btn:hover { color: var(--pink-600); }
.icon-btn svg { width: 16px; height: 16px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: flex-end; gap: 14px; padding: 26px 32px 18px; position: sticky; top: 0; z-index: 5; background: linear-gradient(var(--bg) 70%, rgba(251, 247, 249, 0)); }
.eyebrow { font-family: var(--font-num); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--pink-600); font-weight: 600; }
.topbar h1 { font-size: 26px; margin: 2px 0 0; font-weight: 700; letter-spacing: 0.02em; line-height: 1.25; }
.topbar .spacer { flex: 1; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: 12px; color: var(--plum-700); white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); display: inline-block; flex: none; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px rgba(18, 165, 148, 0.18); }
.dot.off { background: #f2a100; box-shadow: 0 0 0 3px rgba(242, 161, 0, 0.18); }
.menu-btn { display: none; }
.content { padding: 4px 32px 48px; }

/* ---------- Primitives ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-1); }
.card-pad { padding: 20px 22px; }
.sec-title { font-size: 15px; margin: 0 0 14px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.sec-title::before { content: ""; width: 4px; height: 16px; border-radius: 4px; background: var(--grad); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line-strong); background: #fff; color: var(--plum-900); font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none; transition: transform .12s, box-shadow .15s, background .15s, border-color .15s; }
.btn svg { width: 16px; height: 16px; }
.btn:hover { border-color: var(--pink-400); color: var(--pink-700); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: var(--sh-pink); }
.btn.primary:hover { color: #fff; filter: brightness(1.05); }
.btn.soft { background: var(--pink-50); border-color: transparent; color: var(--pink-700); }
.btn.soft:hover { background: var(--pink-100); }
.btn.outline { border-color: var(--pink-400); color: var(--pink-700); }
.btn.danger { color: var(--danger); }
.btn.small { height: 30px; padding: 0 12px; font-size: 12.5px; border-radius: 9px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.link { background: none; border: 0; color: var(--pink-600); cursor: pointer; padding: 2px 5px; font-weight: 600; border-radius: 6px; }
.link:hover { background: var(--pink-50); }
.link.danger { color: var(--danger); }

.field label, .lbl { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; font-weight: 600; }
.input, select.input, textarea.input { width: 100%; border: 1px solid var(--line-strong); border-radius: 12px; padding: 8px 12px; background: #fff; min-height: 40px; transition: border-color .15s, box-shadow .15s; }
.input:focus { outline: none; border-color: var(--pink-400); box-shadow: 0 0 0 4px rgba(228, 0, 127, 0.1); }
textarea.input { resize: vertical; min-height: 96px; line-height: 1.7; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23c2006b' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
input[type=checkbox] { accent-color: var(--pink-600); width: 16px; height: 16px; vertical-align: -3px; }

.avatar { width: 38px; height: 38px; border-radius: 13px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 14px; flex: none; }
.avatar.sm { width: 28px; height: 28px; border-radius: 9px; font-size: 12px; }
.avatar.ai { background: linear-gradient(135deg, #7c5cff, #e4007f); }
.avatar.me-av { background: var(--grad); }

.badge-st { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge-st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-ai_processing { color: var(--st-proc); background: #f1edff; }
.st-ai_answered { color: var(--st-ai); background: #e3f6f3; }
.st-waiting { color: var(--st-wait); background: var(--pink-100); }
.st-in_progress { color: #b77700; background: #fff3d6; }
.st-resolved { color: var(--st-done); background: #f3eef1; }
.pill { display: inline-flex; align-items: center; height: 24px; border-radius: 999px; padding: 0 10px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.pink { background: var(--pink-100); color: var(--pink-700); }
.pill.gray { background: #f3eef1; color: var(--muted); }
.pill.red { background: #ffe6ea; color: var(--danger); }
.pill.green { background: #e3f6f3; color: var(--ok); }

/* ---------- Tables (FAQ / staff / settings) ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; }
.tbl th { text-align: left; font-size: 11.5px; letter-spacing: 0.04em; color: var(--muted); font-weight: 700; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fffafc; }
.tbl th:first-child { border-top-left-radius: var(--r); }
.tbl th:last-child { border-top-right-radius: var(--r); }
.tbl td { padding: 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: #fffafc; }
.tbl td.nw, .tbl th.nw { white-space: nowrap; }
.tbl .clip { min-width: 160px; max-width: 380px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* ---------- Ticket center ---------- */
.tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { position: relative; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: var(--r); padding: 14px 16px 14px; cursor: pointer; box-shadow: var(--sh-1); transition: transform .15s, box-shadow .15s, border-color .15s; overflow: hidden; }
.tile:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.tile .t-label { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; color: var(--plum-700); }
.tile .t-num { font-family: var(--font-num); font-size: 32px; font-weight: 600; line-height: 1.15; margin-top: 6px; letter-spacing: -0.01em; }
.tile.active { border-color: transparent; background: var(--grad); color: #fff; box-shadow: var(--sh-pink); }
.tile.active .t-label { color: rgba(255, 255, 255, 0.9); }
.tile.active .dot { background: #fff !important; box-shadow: none; }
.tile.urgent:not(.active) { border-color: var(--pink-200); background: linear-gradient(180deg, #fff, var(--pink-50)); }
.tile.urgent:not(.active) .t-num { color: var(--pink-600); }

.filterbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px; margin-bottom: 14px; }
.search { position: relative; flex: 1 1 260px; }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--pink-600); }
.search .input { padding-left: 38px; background: var(--pink-50); border-color: transparent; }
.search .input:focus { background: #fff; }
.filterbar .input { width: auto; min-width: 0; }
.filterbar .date { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.filterbar .date .input { width: 150px; }
.filterbar select.input { width: 160px; }

.tlist { display: flex; flex-direction: column; gap: 8px; }
.trow { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; cursor: pointer; transition: transform .12s, box-shadow .15s, border-color .15s; box-shadow: var(--sh-1); }
.trow:hover { transform: translateY(-1px); box-shadow: var(--sh-2); border-color: var(--pink-200); }
.trow.urgent { border-left: 4px solid var(--pink-600); }
.trow .q { font-weight: 700; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow .meta { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); font-size: 12px; margin-top: 3px; }
.trow .meta .no { font-family: var(--font-num); color: var(--plum-700); font-weight: 600; }
.trow .right { display: flex; align-items: center; gap: 12px; }
.trow .ago { font-size: 12px; color: var(--muted); min-width: 64px; text-align: right; }
.trow .assignee { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--plum-700); min-width: 92px; }
.sat { font-size: 16px; width: 22px; text-align: center; }
.pager { display: flex; gap: 8px; justify-content: space-between; align-items: center; padding: 14px 4px 0; }

.empty { text-align: center; padding: 56px 16px; color: var(--muted); }
.empty svg { width: 132px; height: auto; margin-bottom: 10px; }
.empty b { display: block; color: var(--plum-900); font-size: 15px; margin-bottom: 4px; }

/* ---------- Ticket detail ---------- */
.back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px; cursor: pointer; color: var(--plum-700); background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 5px 14px 5px 10px; font-weight: 600; font-size: 13px; }
.back:hover { color: var(--pink-600); border-color: var(--pink-200); }
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; align-items: start; }
.conv { display: flex; flex-direction: column; overflow: hidden; }
.conv-head { padding: 20px 24px 18px; background: var(--grad-soft); border-bottom: 1px solid var(--line); }
.conv-head .no { font-family: var(--font-num); font-size: 12px; color: var(--pink-700); font-weight: 600; letter-spacing: 0.08em; }
.conv-head h2 { margin: 4px 0 10px; font-size: 19px; line-height: 1.45; }
.thread { padding: 22px 24px; display: flex; flex-direction: column; gap: 18px; max-height: calc(100vh - 430px); min-height: 240px; overflow-y: auto; }
.msg { display: flex; gap: 10px; max-width: 86%; }
.msg .body { min-width: 0; }
.msg .who { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.msg .who b { color: var(--plum-900); margin-right: 6px; }
.msg .bubble { padding: 11px 15px; border-radius: 4px 16px 16px 16px; white-space: pre-wrap; word-break: break-word; background: #f6f0f3; line-height: 1.75; }
.msg.ai .bubble { background: #f3f0ff; border: 1px solid #e6dfff; }
.msg.agent { align-self: flex-end; flex-direction: row-reverse; }
.msg.agent .who { text-align: right; }
.msg.agent .bubble { background: var(--grad); color: #fff; border-radius: 16px 4px 16px 16px; }
.msg .tools { margin-top: 4px; text-align: right; }
.msg.system { align-self: center; max-width: 92%; font-size: 12px; color: var(--muted); background: #fff; border: 1px dashed var(--line-strong); border-radius: 999px; padding: 4px 14px; text-align: center; }
.composer { border-top: 1px solid var(--line); padding: 16px 20px 18px; background: #fffbfd; }
.composer textarea { min-height: 104px; background: #fff; }
.composer .hint { font-size: 12px; color: var(--muted); }
.info dl { display: grid; grid-template-columns: 84px 1fr; gap: 10px 12px; margin: 0; }
.info dt { color: var(--muted); font-size: 12px; padding-top: 2px; }
.info dd { margin: 0; word-break: break-word; font-weight: 500; }
.staff-card { display: flex; align-items: center; gap: 12px; padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.staff-card .nm { font-weight: 700; font-size: 15px; }
.alert { border-radius: 12px; padding: 10px 14px; background: #fff7e6; border: 1px solid #f6e0b0; font-size: 13px; margin-bottom: 12px; color: #6b4e00; }
.alert.pink { background: var(--pink-50); border-color: var(--pink-200); color: var(--pink-700); }

/* ---------- FAQ ---------- */
.faq { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 18px; align-items: start; }
.faq > *, .detail > *, .grid2 > * { min-width: 0; }
.tree { padding: 10px; position: sticky; top: 110px; }
.tree button { display: flex; width: 100%; align-items: center; justify-content: space-between; text-align: left; border: 0; background: none; padding: 9px 12px; border-radius: 10px; cursor: pointer; color: var(--plum-700); font-weight: 500; }
.tree button:hover { background: var(--pink-50); }
.tree button.active { background: var(--pink-100); color: var(--pink-700); font-weight: 700; }
.tree .cnt { font-family: var(--font-num); font-size: 12px; color: var(--faint); }
.tree button.active .cnt { color: var(--pink-600); }
.type-icon { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--grad-soft); color: var(--pink-700); font: 700 10.5px var(--font-num); margin-right: 10px; vertical-align: middle; flex: none; }

/* ---------- Reports ---------- */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { padding: 16px 18px; }
.kpi .k { font-size: 12px; color: var(--muted); font-weight: 600; }
.kpi .v { font-family: var(--font-num); font-size: 32px; font-weight: 600; line-height: 1.2; margin-top: 4px; }
.kpi .v small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 3px; font-family: var(--font); }
.kpi.accent { background: var(--grad); color: #fff; border: 0; box-shadow: var(--sh-pink); }
.kpi.accent .k, .kpi.accent .v small { color: rgba(255, 255, 255, 0.88); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.chart-legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.bar-track { background: var(--pink-50); border-radius: 99px; height: 8px; overflow: hidden; min-width: 80px; }
.bar-fill { background: var(--grad); height: 100%; border-radius: 99px; }
.heat { display: grid; grid-template-columns: 26px repeat(24, 1fr); gap: 3px; font-size: 10px; color: var(--muted); font-family: var(--font-num); }
.heat div { height: 20px; border-radius: 5px; }
.heat .lab { background: none; display: flex; align-items: center; font-family: var(--font); }

/* ---------- Tabs / settings ---------- */
.tabs { display: inline-flex; gap: 4px; padding: 5px; background: #fff; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 18px; overflow-x: auto; max-width: 100%; box-shadow: var(--sh-1); }
.tabs button { background: none; border: 0; padding: 8px 16px; cursor: pointer; color: var(--plum-700); border-radius: 10px; white-space: nowrap; font-weight: 600; }
.tabs button:hover { background: var(--pink-50); }
.tabs button.active { background: var(--grad); color: #fff; box-shadow: var(--sh-pink); }
.settings-grid { display: grid; grid-template-columns: 1fr; gap: 18px; max-width: 980px; }
.days { display: flex; gap: 6px; flex-wrap: wrap; }
.days label { border: 1px solid var(--line-strong); border-radius: 10px; padding: 6px 12px; cursor: pointer; background: #fff; }
.sys-list { display: grid; grid-template-columns: 200px 1fr; gap: 12px 14px; align-items: center; }
code { font-family: ui-monospace, Consolas, monospace; background: var(--pink-50); padding: 2px 6px; border-radius: 6px; font-size: 12.5px; color: var(--pink-700); }

/* ---------- Modal / toast ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(43, 15, 34, 0.42); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade .15s ease; }
.modal { background: #fff; border-radius: var(--r-lg); width: min(640px, 100%); max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 30px 80px rgba(43, 15, 34, 0.3); animation: pop .18s ease; }
.modal-head { padding: 20px 24px 14px; display: flex; align-items: center; }
.modal-head h2 { font-size: 18px; margin: 0; flex: 1; }
.modal-body { padding: 4px 24px 20px; display: grid; gap: 14px; }
.modal-foot { padding: 14px 24px 20px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks label { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--line-strong); border-radius: 10px; padding: 5px 10px; cursor: pointer; }
.checks label:has(input:checked) { border-color: var(--pink-400); background: var(--pink-50); color: var(--pink-700); }
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); background: var(--plum-900); color: #fff; padding: 11px 20px; border-radius: 14px; z-index: 60; box-shadow: var(--sh-2); max-width: 90vw; font-weight: 600; animation: rise .2s ease; }
.toast.err { background: var(--danger); }
.pre { white-space: pre-wrap; word-break: break-word; background: var(--pink-50); border: 1px solid var(--line); border-radius: 12px; padding: 14px; max-height: 60vh; overflow: auto; font-size: 13px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-hero { position: relative; overflow: hidden; background: var(--grad); color: #fff; padding: 48px 56px; display: flex; flex-direction: column; }
.login-hero::before, .login-hero::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, 0.1); }
.login-hero::before { width: 520px; height: 520px; right: -160px; top: -160px; }
.login-hero::after { width: 380px; height: 380px; left: -140px; bottom: -150px; }
.login-hero .brand-name, .login-hero .brand-name b { color: #fff; }
.login-hero .logo { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.55); border-radius: 14px; }
.login-hero h2 { font-size: clamp(22px, 2.5vw, 34px); word-break: keep-all; overflow-wrap: anywhere; line-height: 1.4; margin: auto 0 14px; position: relative; z-index: 1; letter-spacing: 0.03em; }
.login-hero p { margin: 0 0 30px; opacity: .9; max-width: 440px; position: relative; z-index: 1; }
.mock { position: relative; z-index: 1; display: grid; gap: 10px; max-width: 420px; margin-bottom: 28px; }
.mock .b { padding: 10px 14px; border-radius: 16px; font-size: 13px; max-width: 86%; box-shadow: 0 8px 24px rgba(80, 0, 40, 0.18); }
.mock .u { justify-self: end; background: #fff; color: var(--plum-900); border-radius: 16px 4px 16px 16px; }
.mock .a { background: rgba(255, 255, 255, 0.18); border: 1px solid rgba(255, 255, 255, 0.35); backdrop-filter: blur(6px); border-radius: 4px 16px 16px 16px; }
.mock .a small { display: block; opacity: .8; font-size: 11px; margin-bottom: 2px; }
.login-form { display: grid; place-items: center; padding: 32px 20px; }
.login-card { width: min(380px, 100%); }
.login-card h1 { font-size: 24px; margin: 0 0 6px; }
.login-card p.sub { color: var(--muted); margin: 0 0 26px; font-size: 13px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 12px; margin: 20px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line-strong); }
.wide { width: 100%; height: 46px; border-radius: 14px; font-size: 14.5px; }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .tiles, .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .search { flex-basis: 100%; }
  .app { grid-template-columns: 248px 1fr; }
  .topbar, .content { padding-left: 24px; padding-right: 24px; }
}
@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; width: 280px; transform: translateX(-105%); transition: transform .2s; z-index: 40; }
  .side.open { transform: none; }
  .menu-btn { display: grid; }
  .topbar { padding: 16px 16px 12px; align-items: center; }
  .topbar h1 { font-size: 21px; }
  .topbar .chips { display: none; }
  .content { padding: 4px 16px 36px; }
  .detail, .faq, .grid2 { grid-template-columns: 1fr; }
  .tree { position: static; }
  .thread { max-height: none; }
  .msg { max-width: 96%; }
  .login { grid-template-columns: 1fr; }
  .login-hero { padding: 28px 24px; }
  .login-hero h2 { font-size: 24px; margin-top: 28px; }
  .mock { display: none; }
}
@media (max-width: 640px) {
  .tiles, .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trow { grid-template-columns: auto 1fr; }
  .trow .right { grid-column: 1 / -1; justify-content: space-between; }
  .trow .assignee { display: none; }
  .filterbar .date .input, .filterbar select.input { width: 100%; }
  .filterbar .date { width: 100%; }
}

/* ---------- 調整 ---------- */
.search .input { width: 100%; }
.me .who, .me .role { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav a { gap: 10px; padding: 8px 9px; }
.nav a .ico { width: 30px; height: 30px; }
@media (min-width: 961px) and (max-width: 1280px) { .app { grid-template-columns: 256px 1fr; } .side { padding: 14px 10px; } }
.topbar { position: static; background: none; }
@media (max-width: 1280px) {
  .detail { grid-template-columns: minmax(0, 1fr) 290px; }
  .composer .hint { display: none; }
  .composer .row { justify-content: flex-end; }
}
@media (max-width: 1100px) { .detail { grid-template-columns: 1fr; } }
