/* flashkata — flat, plain, no gradients or glow. */

:root {
  --bg: #0d0e10;
  --panel: #15171a;
  --panel-2: #1b1e22;
  --line: #2b2f35;
  --line-2: #3a4048;
  --text: #e9ecef;
  --muted: #8b949e;
  --accent: #7fb2ff;
  --ok: #62c98a;
  --danger: #ff7a7a;
  --radius: 4px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

.wrap { max-width: 780px; margin: 0 auto; padding: 36px 20px 72px; }
.wrap.wide { max-width: 1120px; }

header h1 {
  margin: 0 0 4px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
header h1 .mark { color: var(--accent); }
header .sub { margin: 0 0 24px; color: var(--muted); font-size: 14px; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 4px 0 0; }

/* --- drop zone --- */
.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; text-align: center; cursor: pointer;
  border: 1px dashed var(--line-2); border-radius: var(--radius);
  padding: 30px 18px; background: var(--panel-2);
}
.drop:hover, .drop.hot { border-color: var(--accent); border-style: solid; }
.drop strong { font-size: 15px; font-weight: 600; }
.drop span { color: var(--muted); font-size: 12px; }

.picked { margin: 0; font-size: 14px; word-break: break-all; }
.picked b { color: var(--ok); font-weight: 600; }

.row { display: flex; gap: 20px; flex-wrap: wrap; }

fieldset.vis { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
fieldset.vis legend { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; padding: 0 0 4px; }
fieldset.vis label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
fieldset.vis input { accent-color: var(--accent); }

.field { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 150px; }
.field > span { color: var(--muted); font-size: 12px; }

select, input[type="password"], input[type="text"], textarea {
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 9px 11px; font: inherit; width: 100%;
}
select:focus, input:focus { outline: none; border-color: var(--accent); }

.pw { position: relative; display: flex; }
.pw input { padding-right: 44px; }
.eye {
  position: absolute; right: 2px; top: 50%; transform: translateY(-50%);
  background: transparent; border: 0; padding: 6px 10px; line-height: 1;
  font-size: 15px; opacity: .55; cursor: pointer; color: var(--text);
}
.eye:hover, .eye.on { opacity: 1; }

.code-row { display: flex; gap: 8px; }
.code-row input { flex: 1; }
.hint { margin: 0; font-size: 12px; color: var(--muted); }

button {
  font: inherit; cursor: pointer; border-radius: var(--radius);
  border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text);
  padding: 9px 16px;
}
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); border-color: var(--accent); color: #0b0d10; font-weight: 700; }
button.primary:hover { filter: brightness(1.08); }
button.primary:disabled { opacity: .4; cursor: not-allowed; filter: none; }
button.danger { border-color: var(--danger); color: var(--danger); }
button.danger:hover { background: var(--danger); color: #14161a; }
button.small { padding: 4px 9px; font-size: 12px; }
button.plain { border-color: transparent; background: transparent; color: var(--muted); }
button.plain:hover { color: var(--text); }

/* --- expiry banner --- */
.expiry {
  border: 1px solid var(--line-2);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 14px;
  background: var(--panel-2);
}
.expiry b { font-weight: 800; font-size: 15px; }
.expiry .why { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }

.bar-wrap { position: relative; height: 24px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.bar { height: 100%; width: 0; background: var(--accent); }
.bar-wrap span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; font-weight: 700; }

.msg { margin: 0; min-height: 19px; font-size: 13px; }
.msg.error { color: var(--danger); }
.msg.ok { color: var(--ok); }

.result { border-top: 1px solid var(--line); padding-top: 14px; }
.result p { margin: 0 0 8px; color: var(--muted); font-size: 12px; }
.copyrow { display: flex; gap: 8px; }
.copyrow input { flex: 1; font-family: var(--mono); font-size: 13px; }

footer { margin-top: 28px; text-align: center; color: var(--muted); font-size: 12px; }
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--accent); text-decoration: underline; }

/* --- share viewer --- */
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 12px; margin: 0 0 4px; align-items: center; }
.meta b { color: var(--text); font-weight: 600; font-size: 13px; }
.viewer { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #000; }
.viewer img { display: block; max-width: 100%; margin: 0 auto; cursor: zoom-in; }
.viewer video { display: block; width: 100%; max-height: 72vh; background: #000; }
.viewer audio { display: block; width: 100%; padding: 16px; }
.center { text-align: center; }
.gate { display: flex; flex-direction: column; gap: 10px; }
.dl { display: inline-block; margin-top: 12px; color: var(--accent); text-decoration: none; font-size: 14px; }
.dl:hover { text-decoration: underline; }
.pill { display: inline-block; padding: 1px 7px; border-radius: 2px; font-size: 11px; border: 1px solid var(--line-2); color: var(--muted); }
.pill.warn { border-color: var(--danger); color: var(--danger); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* --- lightbox --- */
.lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,.94);
  display: flex; align-items: center; justify-content: center;
  z-index: 50; cursor: zoom-out; padding: 16px;
}
.lightbox img { max-width: 100%; max-height: 100%; }

/* --- qr --- */
.qr-panel { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 12px; }
.qr-panel img { background: #fff; padding: 8px; border-radius: var(--radius); width: 210px; height: 210px; image-rendering: pixelated; }

/* --- tables --- */
.statgrid { display: flex; flex-wrap: wrap; gap: 8px; }
.stat { border: 1px solid var(--line); border-radius: var(--radius); padding: 9px 12px; min-width: 124px; background: var(--panel-2); }
.stat .k { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .07em; }
.stat .v { font-size: 16px; font-weight: 700; font-family: var(--mono); }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 7px 9px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 10px; text-transform: uppercase; letter-spacing: .07em; white-space: nowrap; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--text); }
th .arrow { opacity: .5; font-size: 9px; }
.mono { font-family: var(--mono); }
.scroll { overflow-x: auto; }
.thumb { width: 34px; height: 34px; object-fit: cover; border-radius: 2px; background: var(--panel-2); display: block; }
.rowsel { accent-color: var(--accent); }
tr.hidden-row { display: none; }
.dim { color: var(--muted); }
.nowrap { white-space: nowrap; }

/* --- file / text mode switch --- */
.modes { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -4px 0 2px; }
.mode {
  border: 1px solid var(--line); border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  background: transparent; color: var(--muted); padding: 7px 18px;
}
.mode.on { background: var(--panel-2); color: var(--text); border-color: var(--line-2); }

/* --- rich text editor --- */
.editor-bar { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2); padding: 6px; gap: 4px; margin-bottom: 10px; }
.editor-bar .fmt { width: 30px; height: 28px; padding: 0; display: grid; place-items: center; }
.editor-bar .sep { width: 1px; height: 20px; background: var(--line-2); margin: 0 4px; }
.bar-label { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.swatches { display: flex; gap: 3px; }
.swatch { width: 20px; height: 20px; border-radius: 3px; border: 1px solid var(--line-2); padding: 0; cursor: pointer; }
.swatch:hover { border-color: var(--accent); }
.swatch.reset { background: var(--panel); color: var(--muted); font-size: 11px; display: grid; place-items: center; }
.sizes { display: flex; gap: 3px; }
.sizebtn { padding: 2px 9px; font-size: 12px; }

.editor {
  min-height: 230px;
  max-height: 520px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
  padding: 14px 16px;
  line-height: 1.65;
  outline: none;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}
.editor:focus { border-color: var(--accent); }
.editor:empty::before { content: attr(data-placeholder); color: var(--muted); white-space: pre-wrap; }

/* --- rendered text share --- */
.doc-frame { background: var(--panel-2); }
.doc {
  padding: 20px 22px;
  line-height: 1.7;
  font-size: 15px;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  max-height: 70vh;
  overflow-y: auto;
}
.doc a { color: var(--accent); }
.doc-tools { padding: 10px 12px; border-top: 1px solid var(--line); justify-content: center; }
